Socket
Socket
Sign inDemoInstall

vow

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vow

Promises/A+ proposal compatible promises library


Version published
Weekly downloads
68K
decreased by-25.81%
Maintainers
1
Weekly downloads
 
Created
Source

Vow Build Status

Promises/A+ specification compatible promises library. See https://github.com/promises-aplus/promises-spec.

Getting Started

###In the Node.js### You can install using Node Package Manager (npm):

npm install vow

###In the Browsers###

<script type="text/javascript" src="vow.min.js"></script>

Also RequireJS module format supported.

API

####Vow.promise()#### Create promise

var promise = Vow.promise();    

###Promise API### ####fulfill(value)#### Fulfill promise with given value

promise.fulfill(value);

####reject(reason)#### Reject promise with given reason

promise.reject(error);

####isFulfilled()#### Returns whether the promise is fulfilled

promise.isFulfilled();

####isRejected()#### Returns whether the promise is rejected

promise.isRejected();

####isResolved()#### Returns whether the promise is fulfilled or rejected

promise.isResolved();

####then([onFulfilled], [onRejected])#### Arranges for:

  • onFulfilled to be called with the value after promise is fulfilled,
  • onRejected to be called with the rejection reason after promise is rejected.

Returns a new promise. See Promises/A+ specification for details.

promise.then(onFulfilled, onRejected);

####fail(onRejected)#### Arranges to call onRejected on the promise's rejection reason if it is rejected. ####spread([onFulfilled], [onRejected])#### Like "then", but "spreads" the array into a variadic value handler.

###Vow API### ####isPromise(value)#### Returns whether the given value is a promise.

####fulfill(value)#### Returns a promise that has already been fulfilled with the given value. If value is a promise, returned promise will be fulfilled with fulfill/rejection value of given promise.

####reject(reasonOrPromise)#### Returns a promise that has already been rejected with the given value. If value is a promise, returned promise will be rejected with fulfill/rejection value of given promise.

####resolve(value)#### Returns a promise that has already been fulfilled with the given value. If value is a promise, returns promise.

####when(valueOrPromise, [onFulfilled], [onRejected])#### ####all(promisesOrValues)#### ####allResolved(promisesOrValues)#### ####any(promisesOrValues)#### ####timeout(promise, timeout)####

Keywords

FAQs

Package last updated on 24 Dec 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc