Skip to content

Commit

Permalink
feat(Store): Added feature name to Update Reducers action
Browse files Browse the repository at this point in the history
  • Loading branch information
actra-gschuster authored and MikeRyanDev committed Mar 7, 2018
1 parent d98915f commit 730361e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/store/src/reducer_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ export class ReducerManager extends BehaviorSubject<ActionReducer<any, any>>
addReducer(key: string, reducer: ActionReducer<any, any>) {
this.reducers = { ...this.reducers, [key]: reducer };

this.updateReducers();
this.updateReducers(key);
}

removeReducer(key: string) {
this.reducers = omit(this.reducers, key) /*TODO(#823)*/ as any;

this.updateReducers();
this.updateReducers(key);
}

private updateReducers() {
private updateReducers(key: string) {
this.next(this.reducerFactory(this.reducers, this.initialState));
this.dispatcher.next({ type: UPDATE });
this.dispatcher.next(<Action & {feature: string}>{ type: UPDATE, feature: key });
}

ngOnDestroy() {
Expand Down

0 comments on commit 730361e

Please sign in to comment.