refactor: wait(0) -> immediate

This commit is contained in:
cha0s 2021-04-20 03:21:42 -05:00
parent 1033349dc3
commit 947bdb8a61

View File

@ -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;