Socket
Book a DemoInstallSign in
Socket

@creately/future

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@creately/future

Extended version of the Promise class which has `resolve` and `reject` methods to resolve or reject the underlying promise.

latest
npmnpm
Version
2.0.0
Version published
Weekly downloads
9
-25%
Maintainers
5
Weekly downloads
 
Created
Source

Future

Extended version of the Promise class which has resolve and reject methods to resolve or reject the underlying promise.

import { Future } from '@creately/future';

// Returns a promise which resolves after given time
function sleep( ms: number ): Promise<number> {
    const f = new Future<number>();
    setTimeout(() => f.resolve(Date.now()), ms);
    return f;
}

Keywords

Promise

FAQs

Package last updated on 15 Apr 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