JSFiddle - React, Tailwind, and code Playground

by dfederighi

JavaScript

YUI().use('node','base','yui-later', function(Y) {
    var b = Y.Base.create('timer-test', Y.Base, [], {
        render: function() {
            this.idx = 0;
            this.timer = Y.later(200, this, this._handle, [] , true); 
        },
        _handle: function() {
            this.idx++;
            if (this.idx === 3) this.timer.cancel();
        }
    },
    {
    });
    
    var boo = new b();
    boo.render();
});