All files / src HistoryUtils.js

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16          2x       13x 13x 9x 9x      
/* @flow */
 
import type { RouterHistory } from 'react-router'
 
// eslint-disable-next-line
export const runHistoryListenner = (
  history: RouterHistory,
  onListenHistory: Function,
): Function => {
  let lastHistory = { ...history }
  return history.listen(() => {
    onListenHistory(lastHistory, history)
    lastHistory = { ...history }
  })
}