Skip to content

Instantly share code, notes, and snippets.

@Richienb
Last active July 16, 2020 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Richienb/b09350e0a6a8dbd75a9dc5bd8f8bd66e to your computer and use it in GitHub Desktop.
Save Richienb/b09350e0a6a8dbd75a9dc5bd8f8bd66e to your computer and use it in GitHub Desktop.
Promisify a task
module.exports = taskFunction => {
return (...arguments_) => module.exports.task(taskFunction(...arguments_))
}
module.exports.task = task => new Promise((resolve, reject) => {
task.fork(reject, resolve)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment