UNPKG

471 BTypeScriptView Raw
1import { Reducer } from 'react';
2export declare type ThunkAction<State, Action> = (dispatch: React.Dispatch<Action>, getState: () => State) => void;
3/**
4 * Can be used the same way as useReducer, but allows functions to be passed as
5 * actions (aka thunks).
6 */
7export declare function useThunkReducer<State, Action>(reducer: Reducer<State, Action>, initialState: State, initializer?: (arg: State) => State): [State, React.Dispatch<Action | ThunkAction<State, Action>>];