-
-
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
feat(store): make reducers accessible from ReducerManager #3064
Conversation
Preview docs changes for 7636216 at https://previews.ngrx.io/pr3064-76362166/ |
modules/store/src/reducer_manager.ts
Outdated
@@ -26,6 +25,10 @@ export const UPDATE = '@ngrx/store/update-reducers' as const; | |||
export class ReducerManager | |||
extends BehaviorSubject<ActionReducer<any, any>> | |||
implements OnDestroy { | |||
get reducerSnapshot(): ActionReducerMap<any, any> { |
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'd rather not use snapshot
here
get reducerSnapshot(): ActionReducerMap<any, any> { | |
get currentReducers(): ActionReducerMap<any, any> { |
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.
Thanks for the suggestion.
I will apply it.
I came up with snapshot, since Angular uses this term, too (see ActivatedRoute) and I wanted to reuse already known terms.
But I am fine with currentReducers, too.
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?
The
ActionReducerMap
ofReduceManager
is internal.It is hard to enhance
ActionReducerMap
dynamically.Closes #3049
What is the new behavior?
The
ActionReducerMap
ofReduceManager
can be accessed via getter (READ-ONLY).This allows to get to know which features are registered in the store, at run-time.
Does this PR introduce a breaking change?
Other information