Socket
Socket
Sign inDemoInstall

es6-deferred-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    es6-deferred-promise

A deferred promise implementation on top of Promises/A+ spec.


Version published
Weekly downloads
33
increased by37.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

es6-deferred-promise

A deferred promise implementation on top of Promises/A+ spec. TypeScript definition file included.

Installation

npm install --save es6-deferred-promise

Usage

In ES2015 JavaScript:

const Deferred = require('es6-deferred-promise').Deferred;
const deferred = new Deferred();

deferred.promise
  .then(result => {
    console.log('Result: %s', result);
  });

// Resolving a promise
deferred.resolve('Success!');

// Rejecting a promise
deferred.reject('Failure!');

In TypeScript:

import { Deferred } from 'es6-deferred-promise';

const deferred = new Deferred<string>();

deferred.promise
  .then(result => {
    console.log(result);
  });

deferred.resolve('success');

Testing

npm install
npm test

Keywords

FAQs

Last updated on 11 May 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc