Skip to content
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

Closed
mtaran-google opened this issue Jun 8, 2018 · 7 comments

Comments

@mtaran-google
Copy link
Contributor

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 as Action<T>, but right now Action 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 for ofType 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

@timdeschryver
Copy link
Member

This is already on the roadmap for v7 - #860.

@mtaran-google
Copy link
Contributor Author

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...

@timdeschryver
Copy link
Member

You can take a look in the projects.

@mtaran-google
Copy link
Contributor Author

That's wonderful! I didn't even know github had that feature.

Should that roadmap page be updated to point to the projects, maybe?

@brandonroberts
Copy link
Member

brandonroberts commented Jun 11, 2018

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

@mtaran-google
Copy link
Contributor Author

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'

@brandonroberts
Copy link
Member

Sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants