Can anyone explain why Vue 3 Composition API doesn't update related reactivity data without forced run in setTimeout?
const isLoaded = ref(true);
const tradeInstrumentFiltered = computed(() => {
const _tradeInstrumentsSortAndLimited =
tradeInstrumentsSortAndLimited[props.tradeInstrumentType];
_tradeInstrumentsSortAndLimited.forEach((ti) => {
if (!ti.isTracking) {
if (!isLoaded.value) isLoaded.value = true;
ti.trackQoute();
}
});
// Work well
setTimeout(() => (isLoaded.value = false));
// Doesn't work
// isLoaded.value = false
return _tradeInstrumentsSortAndLimited;
});