Nicer Package Manager

    @xarc/defer

    1.0.0 • Public • Published

    defer

    const makeDefer = require("@xarc/defer");
    
    const defer = makeDefer();
    
    setTimeout(() => defer.resolve("test"), 100);
    
    defer.promise.then(x => console.log("defer promise resolved", x));

    Using custom Promise

    const Promise = require("bluebird");
    const makeDefer = require("@xarc/defer");
    
    const defer = makeDefer(Promise);

    API

    makeDefer([Promise]);

    Returns defer object:

    {
      promise, resolve, reject;
    }

    Keywords

    none

    Install

    npm i @xarc/defer

    DownloadsWeekly Downloads

    38

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    1.76 kB

    Total Files

    3

    Last publish

    Collaborators

    • srinathm85
    • chandub
    • divyakarippath
    • jchip