@shimo/deferred
v1.0.1
Published
A javascript library implement deferred promise proposed by Mozilla.
Downloads
4
Readme
deferred
A javascript library implement deferred promise proposed by Mozilla.
usage
npm i -S @shimo/deferred
import Deferred from '@shimo/deferred'
const deferred = new Deferred<void>();
async function foo() {
await deferred.promise;
console.log('foo');
}
function main() {
foo();
deferred.resolve();
}
main();