r-magnet
Version:
A state management library for React
9 lines (8 loc) • 534 B
TypeScript
import { EffectHandler2 as EffectHandler, ActionParam } from '../typeHelper';
/**
* A hook that allows you to manage side effects in your component based on the action/s.
* And it will automatically unsubscribe when the component unmounts.
* @param actions An array of action functions or a single action function - `generated from createAction()`.
* @param handlerFn A function that accepts the dispatch, getState and action.
*/
export declare function useEmEffect(actions: ActionParam, handlerFn: EffectHandler): void;