Nostalgic Perogi Monogramming

    @creately/future
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    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;
    }

    Install

    npm i @creately/future

    DownloadsWeekly Downloads

    4

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    4.05 kB

    Total Files

    7

    Last publish

    Collaborators

    • damithcgx
    • linatrefai
    • sajeeva
    • rumaizcinergix
    • thisunravisara
    • nuwacgx
    • jziegelaar
    • chandika
    • vinochs
    • shashik_thiwanka
    • sasindu