-
Couldn't load subscription status.
- Fork 1.4k
Open
Labels
Description
const test = useAsyncComputed$(() => Promise.resolve(10));
useTask$(() => {
console.log('abcd');
test.value;
})The "abcd" will be logged twice, because test.value throws a promise to resolve it sync.
Possible solutions:
- expose the
retryOnPromisefunction, user needs to wrap any .value call of async computed likeawait retryOnPromise(() => test.value); - new method on async computed called
resolve, under the hood it will call compute wrapped in retryOnPromise. It returns promise. User needs to await for it. - before running a task check the scope vars deeply to see if there are async computed signals (can slowdown a qrl execution)
in first two cases also eslint rule is needed and warn user about consequences not using retryOnPromise or resolve
wmertens
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In progress