Closed CzBuCHi closed 6 years ago
Hi @CzBuCHi, Thanks for this PR, I'm in the middle of finishing a design for a new API for this library, I'll come back to this issue in two days.
I wait then ....
btw: After some more learning about redux i found, that redux's createStore
method has same issue (cast to AnyAction)
fixed that too with this: (again calls original method underhood)
function createStore<S, A>(reducer: Reducer<S, A>, enhancer?: StoreEnhancer<S>): Store<S>;
function createStore<S, A>(reducer: Reducer<S, A>, initialState: S, enhancer?: StoreEnhancer<S>): Store<S>;
but that got me thinking, that both these changes should be in redux itself (technically these are only typescript shenanigans with no changes in js) and not here ...
Anyway i wait for your input on this ....
Perhaps you're using redux v3? If yes then read this section please: https://github.com/piotrwitek/react-redux-typescript-guide#type-definitions-for-react--redux
And in that case yes, this doesn't have anything to do with this lib.
yup ... im on wrong repo :) ... thanks for your time ...
added typed version of
combineReducers
method from 'redux', usage is the same as original method, except mine has two required generics type parameters - state type and actions typeusage:
original method throws this error (reason for this PR):
PS: edit in package.json is required on my machine (tslint fails otherwise)