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): document new bevahior of on #2144

Closed
timdeschryver opened this issue Oct 3, 2019 · 0 comments · Fixed by #2146 or TypescriptID/platform#261
Closed

docs(store): document new bevahior of on #2144

timdeschryver opened this issue Oct 3, 2019 · 0 comments · Fixed by #2146 or TypescriptID/platform#261
Labels
Accepting PRs community watch Someone from the community is working this issue/PR Comp: Docs Good First Issue Good issue for first-time contributor

Comments

@timdeschryver
Copy link
Member

Other information:

With #2103 merged, we have to change the documentation.

Before the behavior was that if an action was registered twice via the on function in createReducer, the last one would override the previous ones.

The new behavior allows multiple on functions for the same action, in the same createReducer.

I could only find one occurrence of it at:

* - Must be used with `ActionCreator`'s (returned by `createAction`). Cannot be used with class-based action creators.
* - An action type should only be associated with at most one state change function, similar to switch statements.
* - In the case this is violated, the latest defined associated will be used (the latest `on` function passed).
* - The returned `ActionReducer` should additionally be returned from an exported `reducer` function.
* This is because [function calls are not supported](https://angular.io/guide/aot-compiler#function-calls-are-not-supported) by the AOT compiler.

@timdeschryver timdeschryver added Comp: Docs Accepting PRs Good First Issue Good issue for first-time contributor labels Oct 3, 2019
@timdeschryver timdeschryver changed the title docs(store): docs(store): document new bevahior of on Oct 3, 2019
@timdeschryver timdeschryver added the community watch Someone from the community is working this issue/PR label Oct 5, 2019
brandonroberts pushed a commit that referenced this issue Oct 5, 2019
jordanpowell88 pushed a commit to jordanpowell88/platform that referenced this issue Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs community watch Someone from the community is working this issue/PR Comp: Docs Good First Issue Good issue for first-time contributor
Projects
None yet
1 participant