promise-fnapply
A Function.apply that can deal with promise arguments
Installation
Install promise-fnapply
using npm:
npm install --save promise-fnapply
Usage
Module usage
const apply = ; { return `hello `;} ;
API
apply(fn, promises, thisArg)
Name | Type | Description |
---|---|---|
fn |
Function|Promise<Function> |
The function, or a promise resolving to a function, to apply with the resolved promises as argument array |
promises |
Array<Promise> |
The arguments array to pass to fn when they all are resolved |
thisArg |
Any |
The value to be passed as this when calling fn |
Returns: Promise
, which resolves to the result of applying fn
with the resolved values of promises
.
Related
License
MIT © Joakim Carlstein