Skip to content

Conversation

@Validark
Copy link

@Validark Validark commented Aug 8, 2022

  • all no longer accepts non-promises in the input array
  • allSettled now preserves array/tuple length where possible
  • some can take in a positive, non-decimal numeric literal type and convert it to a tuple of the right length.
  • all/allSettled/race/some/any now all:
    • accept readonly arrays, since these methods don't mutate in-place
    • accept arrays with different Promise types in them, e.g. [Promise<number>, Promise<string>] now works
  • for race/any, we transform [Promise<number>, Promise<string>] into Promise<number | string> rather than Promise<number> | Promise<string>. For some it is the same but an array: Promise<(number | string)[]>

As opposed to #138, this PR does not publicly expose BuildTuple.

- `all` no longer accepts non-promises in the input array
- `allSettled` now preserves array/tuple length where possible
- `some` can take in a positive, non-decimal numeric literal type and convert it to a tuple of the right length.
- `all`/`allSettled`/`race`/`some`/`any` now all:
  - accept readonly arrays, since these methods don't mutate in-place
  - accept arrays with different Promise types in them, e.g. `[Promise<number>, Promise<string>]` now works
- for `race`/`any`, we transform `[Promise<number>, Promise<string>]` into `Promise<number | string>` rather than `Promise<number> | Promise<string>`. For `some` it is the same but an array: `Promise<(number | string)[]>`
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.

1 participant