vue-async-computed
vue-async-computed copied to clipboard
$asyncComputed state
$requestState.state is always updating
if computed resolves to 0
. It is never becomes success
.
Hey, I've added a test case that tries to test this issue, but I'm not managing to reproduce it. Can you take a look, and help me track down what's causing your issue?
Hm. I can add I'm using default: null
option too. And my async function resolves for about 1 second.
Maybe, it helps to reproduce the error.
Neither of those should matter (especially since the default default
is already null
.) I've run a variant of the test with a 1-second long timeout and an explicit default: null
, but I still can't reproduce this.
Can you give me a code excerpt that seems to trigger this behaviour for you?
computed: {
isLoading() {
return this.$asyncComputed.someOperation.updating;
}
}
...
asyncComputed: {
someOperation: {
default: null,
get() {
return asyncFnReturnsZero();
}
}
}
If the asyncFnReturnsZero
resolves in a non-zero value everything goes ok, but if in zero, isLoading
is always true
;
I see what you're saying, and I've tried to replicate exactly that in the test suite here: https://github.com/foxbenjaminfox/vue-async-computed/blob/3be0d8590bf772bf05c86845347e63318438f9ab/test/index.js#L1017-L1050
The test still passes just fine, so I doubt that the problem is in something the test covers here. Is it possible that something else is going on here? Perhaps a reactivity issue of some sort in your code? (Along the lines of #18?)
If you can make an example (e.g. in codepen.io) that shows this issue happening, I'll look into it further.