Closed mpetuska closed 1 year ago
Some additional tests are still missing but public API is final.
I'm not following why adding a type for action to Store. What is the need this is fulfilling? To require a common subclass for all actions? I'm in favor of not requiring a type for actions. Most stores would use Any as action type and requiring a common subclass is just adding complexity & confusion imo.
The ReducerForAction
type was used along with some other code as a way reduce type checking in reducers and make them more concise. I think a full example of how it was used is lacking. Not sure this is even a real issue.
To be clear, this feature set is entirely opt in. The benefits are typesafe dispatchers and reducers. The downsides are that some enchancers might become unavailable (e.g. thunk). In any case, traditional stores and reducers remain exactly the same. I'll bring back removed typealiases with deprecation in the next patch to this.
I personally missed typesafe store in some of my projects as well.
@patjackson52 PR is ready for review. Here are a few things I'd like you to double-check while reviewing:
Typed
entities are entirely opt-in
Closes #92 Closes #46