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

[docs] Store: make clear that featureName becomes application state slice name #263

Closed
GiuseppePiscopo opened this issue Aug 11, 2017 · 0 comments

Comments

@GiuseppePiscopo
Copy link

I'm submitting a...


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

What is the current behavior?

Docs on feature module state composition only explains to invoke forFeature with a map of reducers with a given feature name:

StoreModule.forFeature('featureName', reducers, { })

"[...] This method defines the name of the feature state and the reducers that make up the state."

Expected behavior:

Docs should further clarifiy that passed feature name will be taken as the state slice name to compose the greater app state. Hence, that name will be also needed when slicing state with selector: store.select('featureName').

This would make quite clear that reducer map should not be:

export const reducerMap = {
  'sliceName': {
    <some map of reducers for feature>
  },
};

but instead drop the first level and go straight to the inner one:

export const reducerMap = {
  <some map of reducers for feature>
};

Minimal reproduction of the problem with instructions:

Version of affected browser(s),operating system(s), npm, node and ngrx:

Other information:

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

No branches or pull requests

2 participants