@micro-js/thunk-to-promise

1.0.0 • Public • Published

thunk-to-promise

Build status Git tag NPM version Code style

Convert a thunk to a promise.

Installation

$ npm install @micro-js/thunk-to-promise

Usage

var thunkToPromise = require('@micro-js/thunk-to-promise')

thunkToPromise(function (cb) {
  cb(null, 1, 2)
}).then(function (res) {
  res // => [1, 2]
})

Api

thunkToPromise(thunk)

  • thunk - thunk to convert

Returns: a promise

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @micro-js/thunk-to-promise

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • micro-js