the scope to bind the function to
a function to execute async
Optional
delay: numberthe delay in msec
Rest
...partials: Partialsthe arguments pushed to the callback during execution.
the function which runs the cb async
Rest
...args: any[]use apprt-core/async with plain functions instead
import bindAsync from "apprt-core/bindAsync";
class Counter {
constructor(){
this.count = 0;
}
inc(){
return ++this.count;
}
}
let counter = new Counter();
let asyncInc = bindAsync(counter,"inc");
// execute counter.inc() async
asyncInc()
// result === 1
.then(result => console.log(result));
use apprt-core/async with plain functions instead
Generated using TypeDoc
Combination of bind and async. Binds a method to a given scope and arguments and runs it async.