hapood / redux-arena

Bundling reducers, actions, saga and react-component when using Redux
Apache License 2.0
134 stars 7 forks source link

Change propsPicker for typescript type infer #18

Closed hapood closed 7 years ago

hapood commented 7 years ago

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>;