redux-kotlin
redux-kotlin copied to clipboard
createThreadSafeStore doesn't support ReducerForActionType
To create a store using createThreadSafeStore, you must provide:
typealias Reducer<State> = (state: State, action: Any) -> State
And not:
typealias ReducerForActionType<TState, TAction> = (state: TState, action: TAction) -> TState
Can we add support for the latter?
I think it's okay to design this way,ReducerForActionType is designed to quickly create a sliceReducer where you know exactly the type of state and action.
The reducer parameter in createThreadSafeStore may be a function that needs to combine multiple sliceReducers, so it is reasonable for its action type to be designed as any