Code Monkey home page Code Monkey logo

Comments (9)

jsor avatar jsor commented on May 8, 2024

See domenic/promises-unwrapping#75

from promise.

joshdifabio avatar joshdifabio commented on May 8, 2024

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?

from promise.

joshdifabio avatar joshdifabio commented on May 8, 2024

Note that both icicle and amp throw exceptions in such cases:

https://github.com/amphp/amp/blob/v1.1.0/lib/functions.php#L388
https://github.com/icicleio/icicle/blob/v0.9.6/src/Awaitable/functions.php#L301

from promise.

jsor avatar jsor commented on May 8, 2024

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.

from promise.

joshdifabio avatar joshdifabio commented on May 8, 2024

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.

from promise.

jsor avatar jsor commented on May 8, 2024

@joshdifabio yes 👍

from promise.

clue avatar clue commented on May 8, 2024

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

from promise.

jsor avatar jsor commented on May 8, 2024

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?

from promise.

clue avatar clue commented on May 8, 2024

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 👍

from promise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.