[Vuejs]-Debounced function calls delayed but all executed when wait timer ends

2👍

You’re creating a throttled function every time you keydown (you should probably be using input instead by the way). You can do this instead I think…

methods: {
  searchOnType: throttle((currentPage, searchString) => {
    this.getMovies('movies.json', currentPage, searchString)
  }, 1000, {leading: false, trailing: true})
}

Leave a comment