setTimeout shortcut
delay(function(){
//...
}, 5000)
test async function
async function fetch(){
try{
let data = await wait({
code: 0
});
}catch(e){
console.error(e)
}
}
simple queue manager
let queue = queuer();
queue.exec(()=>{
console.log(1)
})
queue.exec(()=>{
console.log(2)
});
wait().then(()=>{
queue.ready();
})
queue.exec(()=>{
console.log(3)
})
//result: 1, 2, 3