Closed
Description
There's a definition of a ReducerForAction
which cannot be used in order to create a store. A suggestion could be smth like this:
/**
* See also https://github.com/reactjs/redux/blob/master/docs/Glossary.md#reducer
*/
typealias Reducer<State> = ReducerForActionType<State, Any>
/**
* Reducer for a particular subclass of actions. Useful for Sealed classes &
* exhaustive when statements. See [reducerForActionType].
*/
typealias ReducerForActionType<TState, TAction> = (state: TState, action: TAction) -> TState
and then make sure that the store can handle the ReducerForActionType<TState, TAction>
Personally I would change this the other way around and make the reducer be the one with the defined action:
/**
* See also https://github.com/reactjs/redux/blob/master/docs/Glossary.md#reducer
*/
typealias Reducer<State, Action> = (state: State, action: Action) -> State
/**
* ...
*/
typealias AnonymActionReducer<State> = Reducer<State, Any>
Metadata
Metadata
Assignees
Labels
No labels