View debounce-service_test.js
/* | |
The following code tests functionality for the following angular implementation of debounce: | |
http://stackoverflow.com/a/13320016/2415971 | |
app.factory('debounce', ['$timeout','$q', function($timeout, $q) { | |
return function debounce(func, wait, immediate) { | |
var timeout; | |
var deferred = $q.defer(); | |
return function() { | |
var context = this, args = arguments; |