diff options
author | 2021-09-14 19:58:52 +0200 | |
---|---|---|
committer | 2021-09-14 19:58:52 +0200 | |
commit | 95df3522a15631abc51a4295cae0ea401a8d4e1e (patch) | |
tree | e5eb0f368c947683f01458e912f21756fb0d99cb /src/actions/lib/actions.ts | |
parent | docs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff) | |
download | ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip |
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to 'src/actions/lib/actions.ts')
-rw-r--r-- | src/actions/lib/actions.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/actions/lib/actions.ts b/src/actions/lib/actions.ts index ed42eabc0..412a0d895 100644 --- a/src/actions/lib/actions.ts +++ b/src/actions/lib/actions.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | export const createActionsFromDefinitions = (actionDefinitions, validate) => { | 1 | export const createActionsFromDefinitions = (actionDefinitions, validate) => { |
2 | const actions = {}; | 2 | const actions = {}; |
3 | // eslint-disable-next-line unicorn/no-array-for-each | ||
3 | Object.keys(actionDefinitions).forEach(actionName => { | 4 | Object.keys(actionDefinitions).forEach(actionName => { |
4 | const action = (params = {}) => { | 5 | const action = (params = {}) => { |
5 | const schema = actionDefinitions[actionName]; | 6 | const schema = actionDefinitions[actionName]; |
@@ -14,6 +15,7 @@ export const createActionsFromDefinitions = (actionDefinitions, validate) => { | |||
14 | listeners.splice(listeners.indexOf(listener), 1); | 15 | listeners.splice(listeners.indexOf(listener), 1); |
15 | }; | 16 | }; |
16 | action.notify = params => | 17 | action.notify = params => |
18 | // eslint-disable-next-line unicorn/no-array-for-each | ||
17 | action.listeners.forEach(listener => listener(params)); | 19 | action.listeners.forEach(listener => listener(params)); |
18 | }); | 20 | }); |
19 | return actions; | 21 | return actions; |
@@ -21,6 +23,7 @@ export const createActionsFromDefinitions = (actionDefinitions, validate) => { | |||
21 | 23 | ||
22 | export default (definitions, validate) => { | 24 | export default (definitions, validate) => { |
23 | const newActions = {}; | 25 | const newActions = {}; |
26 | // eslint-disable-next-line unicorn/no-array-for-each | ||
24 | Object.keys(definitions).forEach(scopeName => { | 27 | Object.keys(definitions).forEach(scopeName => { |
25 | newActions[scopeName] = createActionsFromDefinitions( | 28 | newActions[scopeName] = createActionsFromDefinitions( |
26 | definitions[scopeName], | 29 | definitions[scopeName], |