-
Notifications
You must be signed in to change notification settings - Fork 24
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.
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);