I think debounce would be more appropriate for your use case.
In summary, throttle limits the execution rate of a function to once every X milliseconds, while debounce delays the function execution until an event has stopped occurring for X milliseconds.
watch: {
filter: {
handler: _.debounce(function () {
this.$inertia.get('/contacts', { filter: this.filter }, {
preserveState: true,
replace: true,
preserveScroll: true,
});
}, 400),
deep: true
}
},
Edit: But that doesn't answer why it's not preserving state. Can you share the entire component?