Git Product home page Git Product logo

Comments (3)

foxbenjaminfox avatar foxbenjaminfox commented on July 26, 2024 1

I've just released a new version including this feature.

Thank you for the idea! This certainly does seem like a feature that could be quite handy to have available.

from vue-async-computed.

foxbenjaminfox avatar foxbenjaminfox commented on July 26, 2024

The main issue with this is that currently, the default values are set in the beforeCreated hook, so in your example it would be called before this.postId is set. (Putting aside the slight error in the example you gave: The arrow function has a lexically scoped this, so this.postId wouldn't refer to what you'd want it to regardless. But that's a separate matter.)

So, what are the options? Well, I could move the computation of the defaults to the created hook instead. That would mostly work, but it would technically be a breaking change. I could move only function defaults to the created hook, but that would be confusing.

Unless I can think of a better idea, I'll probably choose the first option, which would necessitate a major version bump, but that's not the end of the world. Still, I'd rather avoid breaking backwards compatibility needlessly, even if almost no one is relying on the defaults already being defined before their data function is called.

from vue-async-computed.

mdreizin avatar mdreizin commented on July 26, 2024

@foxbenjaminfox Thank you for quick implementation of this feature ;)

from vue-async-computed.

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.