src/core/fsm.js
function _transitionTo( nextState, action, data )
	{
		_cancelled 				= false;
		_transitionCompleted 	= false;

		if( isCancelled() ) { return false; }

		if( _currentState ) {
			let previousState = _currentState;
			if(_options.history){ _history.push(previousState.name); }
		}
		
		_currentState = nextState;

		if( action ) {
			_stateChangedHandler( action, data ); 
		} else {
			_transitionCompleted = true;
			FSM.log('State transition Completed! Current State :: ' + _currentState.name );
			stateChanged.dispatch(_currentState);
		}
	}
function _transitionTo( nextState, action, data )
	{
		_cancelled 				= false;
		_transitionCompleted 	= false;

		if( isCancelled() ) { return false; }

		if( _currentState ) {
			let previousState = _currentState;
			if(_options.history){ _history.push(previousState.name); }
		}
		
		_currentState = nextState;

		if( action ) {
			_stateChangedHandler( action, data ); 
		} else {
			_transitionCompleted = true;
			FSM.log('State transition Completed! Current State :: ' + _currentState.name );
			stateChanged.dispatch(_currentState);
		}
	}
function _transitionTo ( nextState , action , data ) { _cancelled = false ; _transitionCompleted = false ; if ( isCancelled ( ) ) { return false ; } if ( _currentState ) { let previousState = _currentState ; if ( _options . history ) { _history . push ( previousState . name ) ; } } _currentState = nextState ; if ( action ) { _stateChangedHandler ( action , data ) ; } else { _transitionCompleted = true ; FSM . log ( 'State transition Completed! Current State :: ' + _currentState . name ) ; stateChanged . dispatch ( _currentState ) ; } }
transition to the next state
@param  {object} nextState        new state object
@param  {string} action           actionID
@param  {object} data             data sent with the action
@param  {string} actionIdentifier state and action combined to make a unique string
transition to the next state