Skip to content

Instantly share code, notes, and snippets.

@arvinall
arvinall / create-timer.js
Last active May 10, 2023 13:39
Create multiple timers with just one setTimeout call
function createPromise () {
let resolve, reject
// eslint-disable-next-line promise/param-names
const promise = new Promise((...args) => ([resolve, reject] = args))
return { promise, resolve, reject }
}
const remove = (a, y) => (