@@ -3,35 +3,22 @@ import 'styles/base';
33
44import React from 'react' ;
55import { render } from 'react-dom' ;
6- import createLogger from 'redux-logger ' ;
6+ import createLogger , { defaults } from '../../src ' ;
77
88import { createStore , combineReducers , applyMiddleware , compose } from 'redux' ;
99import { Provider } from 'react-redux' ;
1010
1111import Example from 'components/example' ;
1212import reducers from 'reducers' ;
13- import { AUTH_REMOVE_TOKEN , AUTH_SET_INFO , AUTH_SET_TOKEN } from 'constants/auth' ;
13+ import { AUTH_REMOVE_TOKEN , AUTH_SET_TOKEN } from 'constants/auth' ;
1414
1515const logger = createLogger ( {
1616 predicate : ( getState , action ) => action . type !== AUTH_REMOVE_TOKEN , // log all actions except AUTH_REMOVE_TOKEN
17- level : {
18- prevState : ( ) => `info` ,
19- action : ( { type } ) => type === AUTH_SET_INFO ? `error` : `log` ,
20- error : ( ) => `error` ,
21- nextState : ( ) => `info` ,
22- } ,
2317 duration : true ,
24- actionTransformer : ( action ) => ( {
25- ...action ,
26- type : String ( action . type ) ,
27- } ) ,
2818 colors : {
29- prevState : ( ) => `#FFEB3B` ,
30- action : ( { type } ) => type === AUTH_SET_INFO && `red` ,
31- nextState : ( ) => `#4CAF50` ,
19+ ...defaults . colors ,
20+ action : ( { type } ) => type === AUTH_SET_TOKEN && `green` ,
3221 } ,
33- diff : true ,
34- diffPredicate : ( getState , action ) => action . type === AUTH_SET_TOKEN ,
3522} ) ;
3623
3724const reducer = combineReducers ( reducers ) ;
0 commit comments