JSFiddle - React, Tailwind, and code Playground

by nuysoft

HTML

<script src="http://g.tbcdn.cn/thx/brix-release/0.1.0/require-config-css-animation.js"></script>

<div bx-name="hello"></hello>

JavaScript

define('hello', ['brix/loader', 'jquery'], function(Loader, $) {
    function Hello() {}
    Hello.prototype.render = function() {
        this.element.innerText = 'hello brix loader'

        var defer = $.Deferred()
        Loader.boot(true, this.element, function() {
            alert('done x2')
            defer.resolve()
        })

        return defer.promise()
    }
    return Hello
})

require(['brix/loader'], function(Loader){
    Loader.boot(function(){
		alert('done x1')
    })
})