Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for multiple promises #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pawelkleczek
Copy link

Also in this PR:

  1. Dependency update
  2. Change tslint to eslint as it seems to work better now
  3. Add nvmrc file to 'kind of' lock the node version and sugest using one

@pawelkleczek
Copy link
Author

@scopsy will you be able to take a look?

* @param { Promise } promise
* @param { Object= } errorExt - Additional Information you can pass to the err object
* @return { Promise }
* Resolves a promise to an array containting error (or undefined if promise succeeds),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Resolves a promise to an array containting error (or undefined if promise succeeds),
* Resolves a promise to an array containing error (or undefined if promise succeeds),

Comment on lines +167 to +182
export function toAll<T1, T2, T3, U = Error>(
values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>],
errorExt?: object
): Promise<[U | null, [T1, T2, T3] | undefined]>;

/**
* Uses Promise.all to resolve with an array containting error (or undefined if all of the promises succeed),
* and an array of results (or null if any of the promises fail)
* @param values An array of Promises.
* @param errorExt Additional Information you can pass to the err object
* @returns A new Promise.
*/
export function toAll<T1, T2, U = Error>(
values: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>],
errorExt?: object
): Promise<[U | null, [T1, T2] | undefined]>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is a better way to represent this in TS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants