Skip to content

Race() accepts an empty array #57

Closed

Description

@joshdifabio

race() currently accepts an empty array, which seems to be a bug.

e8c20be#commitcomment-17349444

Activity

  1. jsor commented on May 4, 2016

    @jsor
    Member
  2. added this to the milestone on May 4, 2016
  3. joshdifabio commented on May 4, 2016

    @joshdifabio
    ContributorAuthor

    I'm struggling to see the value in the never resolved promise approach, despite the arguments made in the linked discussion, which I think are fairly abstract. Can anyone think of a case that race([]) would happen other than in error? What do you think, @jsor, @clue?

  4. jsor commented on May 4, 2016

    @jsor
    Member

    I'd vote for either

    1. Keep race(), make it ES6 compliant and add a warning to the docs (example).
    2. Remove race() in 3.0.
  5. joshdifabio commented on May 4, 2016

    @joshdifabio
    ContributorAuthor

    I'd vote for either

    1. Keep race(), make it ES6 compliant and add a warning to the docs (example).
    2. Remove race() in 3.0.

    What's the thinking behind removing it?

    Edit: The bluebird docs referenced in your post explain your reasoning.

  6. jsor commented on May 4, 2016

    @jsor
    Member

    @joshdifabio yes 👍

  7. clue commented on May 15, 2016

    @clue
    Member

    I'm struggling to see the value in the never resolved promise approach, despite the arguments made in the linked discussion, which I think are fairly abstract. Can anyone think of a case that race([]) would happen other than in error?

    Personally, I haven't had a use for the race() function so far, but this behavior is surprising to say the least, so it makes perfect sense raising this issue 👍

    For bluebird it certainly makes sense to follow ES6. However, this doesn't necessarily apply to this library, considering interoperability with javascript world is a rather moot point.

    I'm currently undecided, but I think we should address this somehow, docs could be a first step.

    if a necessary feature has a high astonishment factor, it may be necessary to redesign the feature
    https://en.wikipedia.org/wiki/Principle_of_least_astonishment

  8. jsor commented on May 16, 2016

    @jsor
    Member

    For bluebird it certainly makes sense to follow ES6. However, this doesn't necessarily apply to this library, considering interoperability with javascript world is a rather moot point.

    Not sure what you are proposing by "not necessarily follow ES6": remove race or keep it in its current implementation?

  9. clue commented on May 20, 2016

    @clue
    Member

    Giving I have no current use for race(), I'm undecided.

    Does removing it altogether really resolve the issue here? :)

    My main concern here would be lack of documentation, but I'm good with either solution 👍

  10. added a commit that references this issue on Jan 8, 2017
    7a797a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions