import { ActionReducer , MetaReducer } from '@ngrx/store' ; import { environment } from 'src/environments/environment' ; export interface State { } export const reducers = { } ; function logger ( reducer ) { return ( state , action ) => { const newState = reducer ( state , action ) ; console . groupCollapsed ( action . type ) ; console . log ( 'previous state' , state ) ; console . log ( 'action' , action ) ; console . log ( 'next state' , newState ) ; console . groupEnd ( ) ; return newState ; } ; } export const metaReducers = ! environment . production ? [ logger ] : [ ] ;