Git Product home page Git Product logo

Comments (8)

justinbmeyer avatar justinbmeyer commented on August 22, 2024 1

resolve is much more accurate. Sometimes other getters might need these values. Those getters would not be able to be able to read the value in the promise synchronously (there is a way as of 4.0).

from bitballs.

justinbmeyer avatar justinbmeyer commented on August 22, 2024 1

In 4.0 you could write:

get(){ return canReflect.getKeyValue(this.promise,”value”) }

from bitballs.

leoj3n avatar leoj3n commented on August 22, 2024

@justinbmeyer Thanks. What is the alternative way for a getter awaiting a promise as of 4.0?

from bitballs.

justinbmeyer avatar justinbmeyer commented on August 22, 2024

This same technique works in 3.0.

from bitballs.

leoj3n avatar leoj3n commented on August 22, 2024

@justinbmeyer Your comment wasn't a response to me was it?

from bitballs.

justinbmeyer avatar justinbmeyer commented on August 22, 2024

It was. What are you looking for? Async getters go back a long way.

from bitballs.

leoj3n avatar leoj3n commented on August 22, 2024

Sorry, I think I probably have misunderstood you.

In your first comment, all this is clear:

resolve is much more accurate. Sometimes other getters might need these values. Those getters would not be able to be able to read the value in the promise synchronously

However, the meaning of this bit in parenthesis was not clear to me:

(there is a way as of 4.0).

I assumed you meant that in 4.0, there exists a new or alternative pattern for a getter awaiting another getter's promise (other than the one discussed in the OP). That's why I followed up with:

What is the alternative way for a getter awaiting a promise as of 4.0?

You let me know the pattern in the OP works in 3.0 as well, but it still is not clear to me what was meant by "there is a way as of 4.0" in regards to being able to read the value in the promise synchronously.

So, it's not clear to me what you were hinting at when you said:

(there is a way as of 4.0).

And that's what I was expecting a reply about!

So, what was meant by "there is a way as of 4.0"?

Anyways, hopefully my misunderstanding here makes sense and you can help clear it up! Thanks.

from bitballs.

leoj3n avatar leoj3n commented on August 22, 2024

That is pretty cool. Thanks

from bitballs.

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.