JSFiddle - React, Tailwind, and code Playground

by brianarn

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/document.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css">

JavaScript

require(["dojo/_base/Deferred"], function(Deferred) {
    var dfd = new Deferred(), i = 0;
    
    function callback() {
        if (i == 3) { cont = new Deferred(); return cont; }
        console.log("success " + i);
        i++;
    }
    function errback() {
        console.log("failure " + i);
        i++
    }
    
    dfd.then(callback, errback)
        .then(callback, errback)
        .then(callback, errback)
        .then(callback, errback)
        .then(callback, errback)
        .then(callback, errback)
        .then(callback, errback)
        .then(callback, errback);
    
    dfd.reject();
});