import { RootState } from '../reducers' ; import { Store , Middleware , MiddlewareAPI , Dispatch } from 'redux' ; export default function LoggerMiddleware ( logImplementation ) { return < RootState > ( store ) => ( next ) => ( action ) : any => { next ( action ) ; const state = store . getState ( ) ; logImplementation ( JSON . stringify ( { action , state : store . getState ( ) } ) ) ; } ; }