@rainder/defer
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    Defer

    Simple Native node.js promise wrapper.

    defer(): dfd

    import { defer } from '@rainder/defer';
     
    const dfd = defer<number>();
     
    dfd.promise.then(...);
    dfd.resolve(...);
    dfd.reject(...);

    defer.callback(fn: Function): Promise

    import { callback } from '@rainder/defer';
     
    callback<Socket>((cb) => {
      socket.write(data, cb);
    }).then(...);

    That's it.

    Keywords

    Install

    npm i @rainder/defer

    DownloadsWeekly Downloads

    4

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    9.09 kB

    Total Files

    6

    Last publish

    Collaborators

    • rainder