inner-promise
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

inner-promise

NPM Build Status

A different way to handle resolve/reject patterns for promises.

improt { innerPromise } from 'inner-promise';

const [val, err] = await innerPromise(myPromise);
if (err) {
    // handle error
} else {
    // do something with value
}

const [[val1, val2], err2] = innerPromise(Promise.all([promise1, promise2]));
if (err2) {
    // handle error
} else {
    // do something with values
}

/inner-promise/

    Package Sidebar

    Install

    npm i inner-promise

    Weekly Downloads

    3

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    3.95 kB

    Total Files

    6

    Last publish

    Collaborators

    • asilvas