src/services/state-router.js
function(data) {
      // Keep the last n states (e.g. - defaults 5)
      var historyLength = _options.historyLength || 5;

      if(data) {
        _history.push(data);
      }

      // Update length
      if(_history.length > historyLength) {
        _history.splice(0, _history.length - historyLength);
      }
    }
function(data) {
      // Keep the last n states (e.g. - defaults 5)
      var historyLength = _options.historyLength || 5;

      if(data) {
        _history.push(data);
      }

      // Update length
      if(_history.length > historyLength) {
        _history.splice(0, _history.length - historyLength);
      }
    }
function ( data ) { // Keep the last n states (e.g. - defaults 5) var historyLength = _options . historyLength || 5 ; if ( data ) { _history . push ( data ) ; } // Update length if ( _history . length > historyLength ) { _history . splice ( 0 , _history . length - historyLength ) ; } }
Internal method to add history and correct length

@param  {Object} data An Object
Internal method to add history and correct length