0.2.1 • Published 9 years ago
mumford v0.2.1
mumford
when().then()
Pass when
a function, once it returns true, the then
function will be resolved.
when
can be chained and will run synchronously.
when(condition).then(function() {
// do something
})
.when(somethingElse).then(function() {
// you can chain when synchronously
});
doUntil().then()
Pass doUntil
a function that takes a parameter next
, an async function can then be executed, calling next in it's own callback. If next
is passed true, it will run again. Passing false will resolve the then
function.
doUntil(function (next) {
var item = input.shift();
someAsyncFunction(function() {
next(true); // passing false will resolve then()
});
}).then(function() {
// do something after
});