examples/async-function.html
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript" src="../AsyncUtils.js"></script>
<script>
var printSomething = AsyncUtils.async(function(something) {
console.log(something);
return 'executed';
});
printSomething('Hello, World').then(function(val) {
console.log(val);
});
console.log('this will be executed before `printSomething`');
</script>
</body>
</html>