src/core/fsm.js
function _processActionQueue()
	{	
		if( _actionQueue.length > 0 ) {
			var stateEvent = _actionQueue.shift();
			
			if(!_currentState.getTarget(stateEvent.action)) {
				_processActionQueue();
			} 
			else {
			}	FSM.action( stateEvent.action, stateEvent.data );

			return false;
		}

		FSM.log('State transition Completed! Current State :: ' + _currentState.name );
		stateChanged.dispatch(_currentState);
	}
function _processActionQueue()
	{	
		if( _actionQueue.length > 0 ) {
			var stateEvent = _actionQueue.shift();
			
			if(!_currentState.getTarget(stateEvent.action)) {
				_processActionQueue();
			} 
			else {
			}	FSM.action( stateEvent.action, stateEvent.data );

			return false;
		}

		FSM.log('State transition Completed! Current State :: ' + _currentState.name );
		stateChanged.dispatch(_currentState);
	}
function _processActionQueue ( ) { if ( _actionQueue . length > 0 ) { var stateEvent = _actionQueue . shift ( ) ; if ( ! _currentState . getTarget ( stateEvent . action ) ) { _processActionQueue ( ) ; } else { } FSM . action ( stateEvent . action , stateEvent . data ) ; return false ; } FSM . log ( 'State transition Completed! Current State :: ' + _currentState . name ) ; stateChanged . dispatch ( _currentState ) ; }
If states have queued up
loop through and action all states in the queue until
none remain
If states have queued up loop through and action all states in the queue until none remain