▲ Stupid ES6 Tricks at engineering.haus.com▼1 up and 0 down, posted by emilong 2943 days ago 3 comments
olalonde 2927 days ago. link parent 1 point ▲ ▼Another one relatively simple: const promisify = fn => (...args) => new Promise(resolve, reject) { fn(...args, (err, result) => { if (err) return reject(err) resolve(result) } }