Skip to content

Instantly share code, notes, and snippets.


Andrew Shelton sheltonial

View GitHub Profile
sheltonial / debounce-service_test.js
Last active Aug 29, 2015
angular debounce service tests
View debounce-service_test.js
The following code tests functionality for the following angular implementation of debounce:
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;