Code Monkey home page Code Monkey logo

Comments (5)

slightlyoff avatar slightlyoff commented on August 15, 2024

The semantics of accept and resolve are different, and accept is the lower-level variant. It sounds like your suggestion is to give accept (now fulfill) the resolve semantics and move the accept semantics to finalAccept?

I'm not sure what that buys us. There is active disagreement about weather or not programmers should use accept or resolve, and removing one or the other is hostile to at least one camp.

from promises.

cowwoc avatar cowwoc commented on August 15, 2024

@slightlyoff,

When would a user ever need to invoke fulfill directly? Shouldn't users always invoke resolve?

from promises.

neonstalwart avatar neonstalwart commented on August 15, 2024

@cowwoc the semantics are different - resolve will unwrap/resolve promises passed as the value whereas fulfill just blindly takes the value it's given and passes it along.

  // Directly resolves the Promise with the passed value
  void fulfill(optional any value);

  // Indirectly resolves the Promise, chaining any passed Promise's resolution
  void resolve(optional any value);

from promises.

cowwoc avatar cowwoc commented on August 15, 2024

So you're saying fulfill() causes the promise to override any values returned by subsequent chains? Why/when when you want to do that?

from promises.

neonstalwart avatar neonstalwart commented on August 15, 2024

Why/when when you want to do that?

see #53 (and i think #26 as well and maybe another or maybe it was in various other places) - a lot of ground has already been covered in those tickets.

from promises.

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.