src/core/transitionViewManager.js
function _fetchViews( viewsToPrepare, actionDataClone, promises, viewCache )
	{
		const views 		= viewsToPrepare,
			  viewManager 	= _options.viewManager,
			  length 		= views.length,
			  currentViewID = actionDataClone.currentViewID,
			  nextViewID 	= actionDataClone.nextViewID;

		let i = 0,
			_deferred,
			view,
			foundView,
			parsedRef,
			viewRef;

		while( i < length )
		{
			viewRef = views[ i ];

			if(viewRef)
			{
				foundView = viewCache[ viewRef ];

				if(!foundView) { // cache the view instance for reuse if needed
					foundView = viewCache[ viewRef ] = viewManager.fetchView( viewRef );
					_deferred = Deferred();
					promises[ promises.length ] = _deferred.promise;

					if( !foundView ){ return TVM.error( viewRef+' is undefined' ); }

					if( foundView.prepareView ){ foundView.prepareView( _deferred ); }
					else { _deferred.resolve(); }
				}

				view = foundView;

				/* change ref to current view or next view to allow general transitions */
				parsedRef = _viewRef(viewRef, [ currentViewID, nextViewID ]);
				if( parsedRef ) {
					actionDataClone.views[ parsedRef ] = view;
				}
				actionDataClone.views[ viewRef ] = view;
			}

			++i;
		}
		
		return actionDataClone;
	}
function _fetchViews( viewsToPrepare, actionDataClone, promises, viewCache )
	{
		const views 		= viewsToPrepare,
			  viewManager 	= _options.viewManager,
			  length 		= views.length,
			  currentViewID = actionDataClone.currentViewID,
			  nextViewID 	= actionDataClone.nextViewID;

		let i = 0,
			_deferred,
			view,
			foundView,
			parsedRef,
			viewRef;

		while( i < length )
		{
			viewRef = views[ i ];

			if(viewRef)
			{
				foundView = viewCache[ viewRef ];

				if(!foundView) { // cache the view instance for reuse if needed
					foundView = viewCache[ viewRef ] = viewManager.fetchView( viewRef );
					_deferred = Deferred();
					promises[ promises.length ] = _deferred.promise;

					if( !foundView ){ return TVM.error( viewRef+' is undefined' ); }

					if( foundView.prepareView ){ foundView.prepareView( _deferred ); }
					else { _deferred.resolve(); }
				}

				view = foundView;

				/* change ref to current view or next view to allow general transitions */
				parsedRef = _viewRef(viewRef, [ currentViewID, nextViewID ]);
				if( parsedRef ) {
					actionDataClone.views[ parsedRef ] = view;
				}
				actionDataClone.views[ viewRef ] = view;
			}

			++i;
		}
		
		return actionDataClone;
	}
function _fetchViews ( viewsToPrepare , actionDataClone , promises , viewCache ) { const views = viewsToPrepare , viewManager = _options . viewManager , length = views . length , currentViewID = actionDataClone . currentViewID , nextViewID = actionDataClone . nextViewID ; let i = 0 , _deferred , view , foundView , parsedRef , viewRef ; while ( i < length ) { viewRef = views [ i ] ; if ( viewRef ) { foundView = viewCache [ viewRef ] ; if ( ! foundView ) { // cache the view instance for reuse if needed foundView = viewCache [ viewRef ] = viewManager . fetchView ( viewRef ) ; _deferred = Deferred ( ) ; promises [ promises . length ] = _deferred . promise ; if ( ! foundView ) { return TVM . error ( viewRef + ' is undefined' ) ; } if ( foundView . prepareView ) { foundView . prepareView ( _deferred ) ; } else { _deferred . resolve ( ) ; } } view = foundView ; /* change ref to current view or next view to allow general transitions */ parsedRef = _viewRef ( viewRef , [ currentViewID , nextViewID ] ) ; if ( parsedRef ) { actionDataClone . views [ parsedRef ] = view ; } actionDataClone . views [ viewRef ] = view ; } ++ i ; } return actionDataClone ; }
loop through and fetch all the requested views, use viewReady
and collect a promise for each to allow the view to build up and perform
its preperation tasks if required

@param  {array} views - string references
@param  {object} actionDataClone - cloned data as to not override config
@param  {array} promises - collect all view promises
@param  {object} viewCache - prevents views from being instantiated and requested more than once
@return {object} populated actionDataClone data object
loop through and fetch all the requested views use viewReady and collect a promise for each to allow the view to build up and perform its preperation tasks if required