-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Adding a generic type parameter to Action to enable cleaner action creator syntax #1116
Comments
This is already on the roadmap for v7 - #860. |
Great to hear! Is there some place that documents what is on the roadmap concisely? I guess there is https://github.com/ngrx/platform/labels/7.x, but the use of that label was not immediately obvious to me before. https://github.com/ngrx/ngrx.github.io/wiki/Roadmap seems somewhat out of date... |
You can take a look in the projects. |
That's wonderful! I didn't even know github had that feature. Should that roadmap page be updated to point to the projects, maybe? |
That wiki is severely out of date and not maintained. We'll most likely revisit where that information goes in the design of ngrx.io |
Would you mind putting up some note at the top of that page saying as much? Since it does currently come up as the top google hit for 'ngrx roadmap' |
Sure |
This post (ctrl-f for "And the winner is") describes a very clean pattern of writing action-creators that required boilerplate using some new typesystem features from TS 2.8. I've implemented this (in a slightly modified way from the blog post) and it works well with 2.8.3 strict mode. However, the default ofType filter needs some additional generic type declarations in order for TS to properly infer that the resulting stream of actions is filtered correctly. I was thinking of sending a PR with my version of the operator that has these additional type declarations, but it makes a lot of use of
{type: T}
. It would be a lot cleaner asAction<T>
, but right nowAction
doesn't take a generic parameter.So what would you think about either making
Action
take a generic parameter, or me sending out a PR with the additional (somewhat ugly) types forofType
to make it work for this kind of case?If accepted, I would be willing to submit a PR for this feature
[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered: