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

Promise.join has an unexpected api #533

Closed
eonarheim opened this issue Oct 27, 2015 · 1 comment
Closed

Promise.join has an unexpected api #533

eonarheim opened this issue Oct 27, 2015 · 1 comment
Assignees
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior good first issue good for people new to open source and Excalibur
Milestone

Comments

@eonarheim
Copy link
Member

Right now Promise.join takes a rest parameter of promises, but it cannot take a simple array of promises.

public static join<T>(...promises: Promise<T>[]) {

Compiles to

 Promise.join = function () {
      var promises = [];
      for (var _i = 0; _i < arguments.length; _i++) {
           promises[_i - 0] = arguments[_i];
      }

This makes it impossible to pass just a simple array. Perhaps changing this altogether or providing an overload.

@eonarheim eonarheim added bug This issue describes undesirable, incorrect, or unexpected behavior good first issue good for people new to open source and Excalibur on-deck labels Oct 27, 2015
@eonarheim eonarheim added this to the vNext milestone Oct 27, 2015
@kamranayub
Copy link
Member

An overload seems reasonable; provides both use cases.

@jedeen jedeen modified the milestones: vNext, 0.7.1 Release Mar 12, 2016
@jedeen jedeen removed the on-deck label Mar 13, 2016
@alanag13 alanag13 self-assigned this Jun 12, 2016
@kamranayub kamranayub assigned kamranayub and unassigned alanag13 Aug 31, 2016
eonarheim pushed a commit that referenced this issue Aug 31, 2016
* Add new Promise.join(promises: Promise<T>[]) signature
* Add unit test coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior good first issue good for people new to open source and Excalibur
Projects
None yet
Development

No branches or pull requests

4 participants