ing
This commit is contained in:
parent
1c4183c62c
commit
1be35047cf
|
@ -3,8 +3,6 @@ import { Type } from '@angular/core';
|
|||
import {
|
||||
ActionReducer,
|
||||
ActionReducerMap,
|
||||
createFeatureSelector,
|
||||
createSelector,
|
||||
MetaReducer
|
||||
} from '@ngrx/store';
|
||||
|
||||
|
@ -24,10 +22,14 @@ export const reducers: ActionReducerMap<State> = {
|
|||
// console.log all actions
|
||||
export function logger(reducer: ActionReducer<State>): ActionReducer<State> {
|
||||
return function (state: State, action: any): State {
|
||||
console.log('state', state);
|
||||
const result = reducer(state, action);
|
||||
console.groupCollapsed(action.type);
|
||||
console.log('prev state', state);
|
||||
console.log('action', action);
|
||||
console.log('next state', result);
|
||||
console.groupEnd();
|
||||
|
||||
return reducer(state, action);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user