Platform: Select slices of state via @select annotation

Created on 20 Sep 2017  路  6Comments  路  Source: ngrx/platform

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request

What is the current behavior?


Currently we need to define a selector for every select operation und use it inside our components.

Expected behavior:


It would be great if we could inject selected slice of state into the components with an @select annotation, like it is done in redux-angular: https://github.com/angular-redux/store/blob/master/articles/select-pattern.md

Most helpful comment

I have created a simple Select decorator. You can look for more info here https://github.com/sandangel/ngrx-utils

All 6 comments

Very little advantage over the select operator and more magic..

This has been discussed at length before, but besides decorators not having access to DI, we're not considering adding these to the API.

Too bad those lengthy discussions are now inaccessible with store issues section gone.

@fxck 馃 :)

The enthusiasm about decorators here makes me question the lifespan of the effects decorator. https://github.com/ngrx/platform/blob/master/docs/effects/README.md

I have created a simple Select decorator. You can look for more info here https://github.com/sandangel/ngrx-utils

Was this page helpful?
0 / 5 - 0 ratings