1.1.0 • Published 4 years ago
@tagoro9/promise-utils v1.1.0
@tagoro9/promise-utils
Set of utility functions to use when working with promises
Installation
yarn add @tagoro9/promise-utilsOr with npm
npm install @tagoro9/promise-utilsUsage
Import the functions that you want to use from the module
Functions
series. Execute an array of promise providers in series and return an array with the result of all promises
import {series} from '@tagoro9/promise-utils';
async function main() {
const data = await series([
() => Promise.resolve(1),
() => Promise.resolve(2)
]); // [1, 2]
}