Closed the-dr-lazy closed 5 years ago
It is handy to have a helper that infers action types that a reducer can handle. A use case scenario for this is creating an epic.
type ActionType<T extends Reducer<any, AnyAction>> = T extends Reducer<any, infer Actions> ? Actions : never
Also, ActionType helper should infer action type from action creator.
ActionType
It is handy to have a helper that infers action types that a reducer can handle. A use case scenario for this is creating an epic.
Possible Implementation