index.js
function(s){
      var currentState = history[historyIndex];
      if(typeof s === 'function'){
        s = s( history[historyIndex].toJS() );
      }

      var newState = currentState.merge(s);
      history = history.slice(0,historyIndex + 1);
      history.push(newState);
      historyIndex++;
      return new Immutable.Map(history[historyIndex]).toJS();
    }
function(s){
      var currentState = history[historyIndex];
      if(typeof s === 'function'){
        s = s( history[historyIndex].toJS() );
      }

      var newState = currentState.merge(s);
      history = history.slice(0,historyIndex + 1);
      history.push(newState);
      historyIndex++;
      return new Immutable.Map(history[historyIndex]).toJS();
    }
function ( s ) { var currentState = history [ historyIndex ] ; if ( typeof s === 'function' ) { s = s ( history [ historyIndex ] . toJS ( ) ) ; } var newState = currentState . merge ( s ) ; history = history . slice ( 0 , historyIndex + 1 ) ; history . push ( newState ) ; historyIndex ++ ; return new Immutable . Map ( history [ historyIndex ] ) . toJS ( ) ; }
ensure that setting state via assignment performs an immutable operation
ensure that setting state via assignment performs an immutable operation