Put in order · Vue.js course · Module 4: Computed & Watch

Debounce pattern with watch

Arrange the steps for implementing debounce with watch from start to finish:

Items to put in order

  • Define a timeout variable (let debounceTimeout)
  • setTimeout(() => { searchQuery.value = value }, 300)
  • clearTimeout(debounceTimeout)
  • watch(searchInput, (value) => { ... })

You can check the correct answer by solving this task in the CodeWorlds game.