docs/assets/app.js
function listen(listener) {
      // Copy of last location.
      var lastPublishedLocation = getLocationInStore(true);

      // Keep track of whether we unsubscribed, as Redux store
      // only applies changes in subscriptions on next dispatch
      var unsubscribed = false;
      var unsubscribeFromStore = store.subscribe(function () {
        var currentLocation = getLocationInStore(true);
        if (currentLocation === lastPublishedLocation) {
          return;
        }
        lastPublishedLocation = currentLocation;
        if (!unsubscribed) {
          listener(lastPublishedLocation);
        }
      });

      // History 2.x listeners expect a synchronous call. Make the first call to the
      // listener after subscribing to the store, in case the listener causes a
      // location change (e.g. when it redirects)
      if (!history.getCurrentLocation) {
        listener(lastPublishedLocation);
      }

      // Let user unsubscribe later
      return function () {
        unsubscribed = true;
        unsubscribeFromStore();
      };
    }
function listen(listener) {
      // Copy of last location.
      var lastPublishedLocation = getLocationInStore(true);

      // Keep track of whether we unsubscribed, as Redux store
      // only applies changes in subscriptions on next dispatch
      var unsubscribed = false;
      var unsubscribeFromStore = store.subscribe(function () {
        var currentLocation = getLocationInStore(true);
        if (currentLocation === lastPublishedLocation) {
          return;
        }
        lastPublishedLocation = currentLocation;
        if (!unsubscribed) {
          listener(lastPublishedLocation);
        }
      });

      // History 2.x listeners expect a synchronous call. Make the first call to the
      // listener after subscribing to the store, in case the listener causes a
      // location change (e.g. when it redirects)
      if (!history.getCurrentLocation) {
        listener(lastPublishedLocation);
      }

      // Let user unsubscribe later
      return function () {
        unsubscribed = true;
        unsubscribeFromStore();
      };
    }
function listen ( listener ) { // Copy of last location. var lastPublishedLocation = getLocationInStore ( true ) ; // Keep track of whether we unsubscribed, as Redux store // only applies changes in subscriptions on next dispatch var unsubscribed = false ; var unsubscribeFromStore = store . subscribe ( function ( ) { var currentLocation = getLocationInStore ( true ) ; if ( currentLocation === lastPublishedLocation ) { return ; } lastPublishedLocation = currentLocation ; if ( ! unsubscribed ) { listener ( lastPublishedLocation ) ; } } ) ; // History 2.x listeners expect a synchronous call. Make the first call to the // listener after subscribing to the store, in case the listener causes a // location change (e.g. when it redirects) if ( ! history . getCurrentLocation ) { listener ( lastPublishedLocation ) ; } // Let user unsubscribe later return function ( ) { unsubscribed = true ; unsubscribeFromStore ( ) ; } ; }
The listeners are subscribed to the store instead of history
The listeners are subscribed to the store instead of history