Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

storyboard

Eser Ozvataf edited this page Jun 17, 2015 · 3 revisions

Storyboard splits a chain of events into phases. It simply waits the end of registered callbacks and promises before advancing to next phase.

Constructing a storyboard

Usage: new $l.storyboard()

var df = new $l.deferred();
 
var st = new $l.storyboard();
st.addPhase('init');
st.addPhase('load');
st.add('load', function () { console.log('load1'); });
st.add('load', function () { console.log('load2'); });
st.add('init', function () { console.log('init1'); });
st.add('init', function () { console.log('init2'); });
st.add('init', df);
st.start();
 
setTimeout(function () { df.resolve(); }, 400);
Clone this wiki locally