$asyncComputed is undefined in computed property
johannes-z opened this issue · 2 comments
johannes-z commented
I wanted to use $asyncComputed.posts.error
in a computed property, but it's undefined and non-reactive. Is there a way to accomplish that?
foxbenjaminfox commented
This should be fixed as of #58.
johannes-z commented
It's still initially undefined
, at least when using watchers. Because of this I can't make computed properties depend on the asyncComputed state, e.g. updating
.
Version used: "vue-async-computed": "^3.6.1"
computed: {
computedProp () {
console.log(this.$asyncComputed.asyncProp) // prints undefined
return ''
}
},
asyncComputed: {
asyncProp: {
lazy: true,
default: () => [],
async get () {
return []
}
}
}
Edit: Please re-open, or should I create a new issue? Here is a repro: https://codesandbox.io/s/l7nno76l3q