Mixin implementation
In your route-driven controller include the mixin and add the debounceQueryParamsMixin
object, like in the following example
// controllers/application.js
import DebounceQueryParamsMixin from 'ember-cli-debounce-query-params';
export default Controller.extend(DebounceQueryParamsMixin, {
queryParams: ['search'],
debounceQueryParams: {
search: 500
},
search: ''
});
// routes/application.js
import Route from '@ember/routing/route';
export default Route.extend({
// ...
queryParams: {
search: {
refreshModel: true
}
},
// ...
});
{{! templates/application.hbs}}
<h2 id="title">Welcome to Ember.js</h2>
<div>
<label>search: {{input value\=debounceSearch}}</label>
</div>