src/xDispatcher.js
function(){
		var me = this,
			dispatchArguments = arguments,
			promises = []
		;

		this._promises = [];

		// A closure is needed for the callback id
		Object.keys( this._callbacks ).forEach( function( id ){

			// All the promises must be set in me._promises before trying to resolve
			// in order to make waitFor work ok
			me._promises[ id ] = me._Promise.resolve()
				.then( function(){
					return me._callbacks[ id ].apply( me, dispatchArguments );
				})
				.catch( function( err ){
					console.error( err.stack || err );
				})
			;

			promises.push( me._promises[ id ] );
		});

		//
		var dequeue = function(){
			me._dispatchQueue.shift();
			if( !me._dispatchQueue.length )
				me._currentDispatch = false;
		};

		return this._Promise.all( promises )
			.then( dequeue, dequeue )
		;
	}
function(){
		var me = this,
			dispatchArguments = arguments,
			promises = []
		;

		this._promises = [];

		// A closure is needed for the callback id
		Object.keys( this._callbacks ).forEach( function( id ){

			// All the promises must be set in me._promises before trying to resolve
			// in order to make waitFor work ok
			me._promises[ id ] = me._Promise.resolve()
				.then( function(){
					return me._callbacks[ id ].apply( me, dispatchArguments );
				})
				.catch( function( err ){
					console.error( err.stack || err );
				})
			;

			promises.push( me._promises[ id ] );
		});

		//
		var dequeue = function(){
			me._dispatchQueue.shift();
			if( !me._dispatchQueue.length )
				me._currentDispatch = false;
		};

		return this._Promise.all( promises )
			.then( dequeue, dequeue )
		;
	}
function ( ) { var me = this , dispatchArguments = arguments , promises = [ ] ; this . _promises = [ ] ; // A closure is needed for the callback id Object . keys ( this . _callbacks ) . forEach ( function ( id ) { // All the promises must be set in me._promises before trying to resolve // in order to make waitFor work ok me . _promises [ id ] = me . _Promise . resolve ( ) . then ( function ( ) { return me . _callbacks [ id ] . apply ( me , dispatchArguments ) ; } ) . catch ( function ( err ) { console . error ( err . stack || err ) ; } ) ; promises . push ( me . _promises [ id ] ) ; } ) ; // var dequeue = function ( ) { me . _dispatchQueue . shift ( ) ; if ( ! me . _dispatchQueue . length ) me . _currentDispatch = false ; } ; return this . _Promise . all ( promises ) . then ( dequeue , dequeue ) ; }
Dispatches an action inmediatelly.

@return {Promise} A promise to be resolved when all the callbacks have finised.
Dispatches an action inmediatelly .