-
Notifications
You must be signed in to change notification settings - Fork 66
[feature request] Use data properties as defaults #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not quite sure how it is an improvement to specify the default in |
There are 2 reasons:
|
vue-apollo does the same thing, data() serves as the placeholder until results from the server are in. |
Same in vuefire. That's why I said it's kind of a vue-way. |
I see. I suppose it is worth having some consistency with I'll add this feature, or if one of you would like to send a PR you could. |
This is not really the vue way to do it. Vue defines properties on the instance as sort of aliases of either pops, data or computed. So the vue way is what asyncComputed is doing currently: Add new properties to the instance (and not transform data properties). Currently, no conflict checking is done between async computed properties and data properties (but that should be done). |
AsyncComputed is an enhancement (convenience implementation) of Vue's computed. These are not defined as component data, but defined when they're created. It follows that AsyncComputed should behave the same way. If one needs default values, use AsyncComputed's own Computed
AsyncComputed
|
Current behavior is also in line with Vue's own |
I know that we can define defaults using the following syntax:
But it would be great if we could use
data
to define defaults as follows:The text was updated successfully, but these errors were encountered: