Ember CLI Debounce Query Parameters
This addon allows for updating queryParams with a defined debounce. It has been specifically designed to solve the following issue:
- You have a model you want to update when a query param changes;
- You don't want to update the history if the users is changing the param in a certain time interval;
A good example for this is a search input field, when you would like to update the results after the users have finished typing.
Installation
$ ember install ember-cli-debounce-query-params
Demo)
Usage (In your route-driven controller include the mixin and add the the debounceQueryParams
property, like in the following example
// controllers/application.js;; ;
If you want to update the model the underneath model when the search param changes:
// controllers/application.js; ;
Then in your templates reference the debounced variables by prepending the debounce keyword, like in the following example
Welcome to Ember.js search: {{input type='text' value=debounceSearch}}
Documentation
ApiThis addon consists only of a mixin that you can include in your route-driven controllers.
Running Tests
ember t
ember t -s