Subscribe on changes!

Debounce and throttle support on "Computed".

avatar
Jan 9th 2023

What problem does this feature solve?

I have a setting using computed to implement dynamic structure. But type words always recalculate computed result too quickly. Also, I need debouce some times to improve performance, when using computed on somewhere user input.

What does the proposed API look like?

const formSetting = computed({ get:()=>{ return {sth...} }, debounce:1000 })

avatar
Jan 9th 2023

Use refDebounced from VueUse instead. Doc: https://vueuse.org/shared/refDebounced/

avatar
Jan 9th 2023

I think it's not a core feature of reactivity, so we should not expect it's implemented by Vue core but by Vue's ecosystem projects.