neallindsay

...joined 10 years ago, and has 496 karma

submissions / comments / favourites

const lockify = f => { let lock = Promise.resolve() return (...args) => { const result = lock.then(() => f(...args)) lock = result.catch(() => {}) return result.then(v => v) } }