Coder Social home page Coder Social logo

Resolving promises with promises about when HOT 5 CLOSED

cujojs avatar cujojs commented on July 27, 2024
Resolving promises with promises

from when.

Comments (5)

briancavalier avatar briancavalier commented on July 27, 2024

Hey, @molnarg, when.js 1.3.0 doesn't support resolving one promise with another. However, this is implemented in the dev branch ... see #40 for more info. It'll be released soon!

from when.

molnarg avatar molnarg commented on July 27, 2024

Thanks for the reference, I will check it out!

But I believe it is a separate issue. You write in the other ticket 'Currently, when.js will use whatever you pass to resolve() verbatim as the resolution value'. This is exactly what I expect in the example above, but something goes wrong.

If I understand the when function correctly, when(promise).then and promise.then should behave exactly the same way no matter what the resolved value will be, right? And this is not the case when you run the example above.

from when.

briancavalier avatar briancavalier commented on July 27, 2024

Yep, there is definitely weirdness in the current release. I tried your example in the dev branch, though, and it appears to work correctly. Please give it a try as well and let me know if you see the same. If not, I'll dig in deeper to figure it out before the next release.

If it looks good then expect a new release very soon. Thanks!

from when.

briancavalier avatar briancavalier commented on July 27, 2024

Just released 1.4.0 which adds support for resolving a deferred promise with another promise, and fixes the inconsistency here. Feel free to reopen this if you find any problems with it.

from when.

molnarg avatar molnarg commented on July 27, 2024

Thank you for the hard work! :) I will check it out soon!

from when.

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.