import { createLogger } from 'redux-logger' ; import { message } from 'antd' ; import undoable , { StateWithHistory } from 'redux-undo' ; import { Reducer , AnyAction } from 'redux' ; export const dva = { config : { onAction : createLogger ( ) , onError ( e ) { message . error ( e . message , 3 ) ; } , onReducer : ( reducer ) => { let undoReducer = undoable ( reducer ) ; return function ( state , action ) { let newState = undoReducer ( state , action ) ; let router = newState . present . router ? newState . present . router : newState . present . routing ; return { ... newState , router : router } ; } ; } , } , } ;