Skip to content

Commit

Permalink
fix(store): work around for vary action type in ActionReducerMap
Browse files Browse the repository at this point in the history
  • Loading branch information
sandangel committed Mar 11, 2018
1 parent 56d75a9 commit 991eed3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/store/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ActionReducer<T, V extends Action = Action> {
(state: T | undefined, action: V): T;
}

export type ActionReducerMap<T, V extends Action = Action> = {
export type ActionReducerMap<T, V extends Action = any> = {
[p in keyof T]: ActionReducer<T[p], V>
};

Expand Down
5 changes: 4 additions & 1 deletion modules/store/src/reducer_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export class ReducerManager extends BehaviorSubject<ActionReducer<any, any>>

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

ngOnDestroy() {
Expand Down

0 comments on commit 991eed3

Please sign in to comment.