hapood / redux-arena

Bundling reducers, actions, saga and react-component when using Redux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change propsPicker for typescript type infer

hapood opened this issue · comments

from:

type PropsPicker<S, AS extends RootState, CP> = (
  state: S,
  actions: ActionCreatorsMapObject,
  allState: AS,
  reducerDict: ReducerDict
) => { [P in keyof CP]: CP[P] };

to

export type StateDict = { [key: string]: {} };

export type ActionsDict = {
  [key: string]: ActionCreatorsMapObject;
};

export type PropsPicker<CP = any> = (
  stateDict: StateDict,
  actionsDict: ActionsDict
) => Partial<CP>;