🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

metaphorjs-promise

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metaphorjs-promise

Bare bones Promises/A+ implementation / ES6 Promise polyfill

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source
Promises/A+ logo #MetaphorJs.Promise Promise/A+ compliant library / ES6 Promise polyfill

7k minified.

####Constructor

  • new Promise(function(resolve, reject))
  • new Promise(thenable)

####Instance

  • promise.then(onFulfill, onReject) -> new promise
  • promise.catch(onReject) -> new promise
  • promise.resolve(value)
  • promise.reject(reason)

####Static

  • Promise.all(iterable) -> new promise
  • Promise.race(iterable) -> new promise
  • Promise.resolve(value) -> new promise
  • Promise.reject(reason) -> new promise

Plus a few extra instance methods:

  • promise.done(onDone[, thisObject]) -> same promise
  • promise.fail(onFail[, thisObject]) -> same promise
  • promise.always(onFinished[, thisObject]) -> same promise
  • promise.promise() -> thenable
  • promise.isPending()
  • promise.isFulfilled()
  • promise.isRejected()

And some extra class methods:

  • Promise.fcall(fn, context, args) -> new promise
  • Promise.allResolved(promises) -> new promise
  • Promise.when(promise1, promise2, ...) -> new promise
  • Promise.waterfall(functions) -> new promise
  • Promise.forEach(items, fn, context) -> new promise
  • Promise.counter(cnt) -> new promise

FAQs

Package last updated on 14 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts