Skip to content

Commit

Permalink
Debounced search
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde committed Aug 11, 2024
1 parent 9a3b7ec commit 21e4780
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/sidebars/search/SearchSideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { NcAppSidebar, NcAppSidebarTab, NcTextField, NcNoteCard, NcCheckboxRadio
import Magnify from 'vue-material-design-icons/Magnify.vue'
import DatabaseOutline from 'vue-material-design-icons/DatabaseOutline.vue'
import FileTreeOutline from 'vue-material-design-icons/FileTreeOutline.vue'
import { debounce } from 'lodash'
export default {
name: 'SearchSideBar',
Expand All @@ -66,11 +67,12 @@ export default {
}
},
watch: {
search: {
handler(search) {
searchStore.getSearchResults()
},
},
search: 'debouncedSearch',
},
methods: {
debouncedSearch: debounce(function() {
searchStore.getSearchResults()
}, 500),
},
}
</script>

0 comments on commit 21e4780

Please sign in to comment.