StratifiedJS
StratifiedJS (http://onilabs.com/stratifiedjs) is an alternative to the await/defer paradigm that offers finer-grained control structures, with intuitive names like waitfor and resume.
â | console.log(â'this code will run right away...'â); |
â | waitfor() { |
â | setTimeout(resume, 500); |
â | } |
â | console.log(â'...and this will run 500ms later.'â); |
Although not widely used, StratifiedJS is an ambitious project thatâs received praise from the likes of John Resig (the creator of jQuery).[62] Note that StratifiedJS is the name of the specification, not the implementation; the official reference implementation is called Oni Apollo.[63]
Get Async JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.