refactor: wait(0) -> immediate
This commit is contained in:
parent
1033349dc3
commit
947bdb8a61
|
@ -6,7 +6,11 @@ export default (latus) => ({
|
|||
SIDE: process.env.SIDE,
|
||||
TickingPromise,
|
||||
wait: (duration) => new TickingPromise(
|
||||
() => {},
|
||||
(resolve) => {
|
||||
if (0 === duration) {
|
||||
resolve(Promise.resolve());
|
||||
}
|
||||
},
|
||||
(elapsed, resolve) => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
duration -= elapsed;
|
||||
|
|
Loading…
Reference in New Issue
Block a user