Closed amc6 closed 6 years ago
You're absolutely right. I was basing my definition of Reducer off the one in the Redux typings, which used to have the same problem. Looks like the latest version of Redux typings marks the state as optional, so this change is a good one. I'll accept the PR and cut a new release.
Thank you very much for the contribution!
Fix is contained in v0.4.5. Thanks again!
The type signature of ReducerBuilder does not allow
undefined
to be passed as the state, even though this should be allowed and is in fact allowed at runtime. The workaround seems to be to pass undefined like so:reducer(undefined as any, action)
. But that's a little ugly especially if you have configured tslint to forbidany
.I believe its a pretty easy change to fix this, and will submit a pull request soon.