-
-
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
docs: add exported reducer function to createReducer examples #1924
Conversation
Preview docs changes for d20221f at https://previews.ngrx.io/pr1924-d20221f/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
export function reducer(state: State | undefined: action: Action) { | ||
return scoreboardReducer(state, action); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work for StoreModule.forFeature
or for ReducerActionMap
. I think we should recommend combineReducers
way if there are more than a single reducer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I think that should be an additional section to talk about combineReducers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't found any. Is it somewhere I missed? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maxime1992 there's an open issue - #1179
@@ -64,26 +65,42 @@ The initial values for the `home` and `away` properties of the state are 0. | |||
|
|||
### Creating the reducer function | |||
|
|||
The reducer function's responsibility is to handle the state transitions in an immutable way. Define a reducer function that handles the actions for managing the state of the scoreboard. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't highlight it but on line 15, we define the reducer function with - The switch statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
d20221f
to
d3d01b1
Compare
Preview docs changes for d3d01b1 at https://previews.ngrx.io/pr1924-d3d01b1/ |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #1762
What is the new behavior?
Does this PR introduce a breaking change?
Other information