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);
There was an error while loading. Please reload this page.