tunk-delay
Sleep, Until and some other function to delay in context, asynchronously with Promise, async/await
npm install delayjs -S
Usage
; async { // sleep await ; ; // until let count = 0; await ; ; // delay,推迟执行, 在设置的时间段内重复调用传入相同delayId的delay函数都会返回false,直到最后一次到达时间点后nextStick返回true; const nextStick = await ; ifnextStick ; };
use with tunk
// index.js;;tunk; // module.js@create { ... } @action async { // sleep await this; ; ... }