remove unused hook
This commit is contained in:
@@ -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]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user