remove unused hook

This commit is contained in:
Pavel Mineev
2021-02-24 12:26:13 -06:00
committed by Umputun
parent 0a4c8dbe45
commit 719b07ec6c
+1 -8
View File
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useCallback, useMemo } from 'preact/compat';
import { useMemo } from 'preact/compat';
import { useDispatch } from 'react-redux';
import { BoundActionCreator, BoundActionCreators } from 'utils/actionBinder';
@@ -19,10 +19,3 @@ export const useActions = <Actions extends { [key: string]: Function }>(
[dispatch, ...Object.values(actions)]
) as any;
};
export const useAction = <Action extends Function>(action: Action): BoundActionCreator<Action> => {
const dispatch = useDispatch();
// @ts-ignore
return useCallback((...args) => dispatch(action(...args)), [dispatch, action]);
};