Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
javascript module loader
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
demo
README.md
wilson.js

README.md

Wilson

All things come to him who waits - provided he knows what he is waiting for.
Woodrow T. Wilson

Wilson is a promise based asynchronous service locator.

Usage

wilson.define('config', [], function(exportModule){     
    exportModule({
        message: "hello"
    });
});

wilson.define('config2', [], function(exportModule){        
    setTimeout(function(){
        exportModule({
            message: "world"
        });         
    }, 1000);
}); 

wilson.define('domReady', [], function(ready){
    window.onload = function(){
        ready();
    };
});

wilson.require(['config', 'config2', 'domReady'], function(config, config2){
    document.getElementById('message').innerHTML = config.message + config2.message;
});
Something went wrong with that request. Please try again.