diff options
author | 2022-10-25 18:14:55 +0530 | |
---|---|---|
committer | 2022-10-25 12:44:55 +0000 | |
commit | b77663a3752467b7be3eff8a765a71330548d8e0 (patch) | |
tree | 16aad95e8d781684b543482f5b4423674f45be08 /src/actions/lib | |
parent | Transform 'AuthLayoutContainer' component hierarchy to tsx (#699) (diff) | |
download | ferdium-app-b77663a3752467b7be3eff8a765a71330548d8e0.tar.gz ferdium-app-b77663a3752467b7be3eff8a765a71330548d8e0.tar.zst ferdium-app-b77663a3752467b7be3eff8a765a71330548d8e0.zip |
refactor: convert Sidebar to typescript (#703)
Diffstat (limited to 'src/actions/lib')
-rw-r--r-- | src/actions/lib/actions.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/actions/lib/actions.ts b/src/actions/lib/actions.ts index ea9a8fe46..da27c2e2b 100644 --- a/src/actions/lib/actions.ts +++ b/src/actions/lib/actions.ts | |||
@@ -18,10 +18,10 @@ export interface Actions { | |||
18 | }; | 18 | }; |
19 | } | 19 | } |
20 | 20 | ||
21 | export const createActionsFromDefinitions = ( | 21 | export const createActionsFromDefinitions = <T extends {}>( |
22 | actionDefinitions: ActionDefinitions, | 22 | actionDefinitions: ActionDefinitions, |
23 | validate: any, | 23 | validate: any, |
24 | ) => { | 24 | ): T => { |
25 | const actions = {}; | 25 | const actions = {}; |
26 | // eslint-disable-next-line unicorn/no-array-for-each | 26 | // eslint-disable-next-line unicorn/no-array-for-each |
27 | Object.keys(actionDefinitions).forEach(actionName => { | 27 | Object.keys(actionDefinitions).forEach(actionName => { |
@@ -41,7 +41,7 @@ export const createActionsFromDefinitions = ( | |||
41 | // eslint-disable-next-line unicorn/no-array-for-each | 41 | // eslint-disable-next-line unicorn/no-array-for-each |
42 | action.listeners.forEach(listener => listener(params)); | 42 | action.listeners.forEach(listener => listener(params)); |
43 | }); | 43 | }); |
44 | return actions; | 44 | return actions as T; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | export default (definitions, validate) => { | 47 | export default (definitions, validate) => { |