import { State , Store } from '../types/redux' ; import { onStateChange } from './utils' ; export class Forwarder { store : Store ; prevState : State ; constructor ( params ) { this . store = params . store ; this . prevState = params . store . getState ( ) ; } setup ( ) { this . store . subscribe ( ( ) => { const state = this . store . getState ( ) ; process . nextTick ( ( ) => { onStateChange ( this . prevState , state , this . store . dispatch ) ; this . prevState = state ; } ) ; } ) ; } }