Skip to content

Instantly share code, notes, and snippets.

Andrew Shelton sheltonial

View GitHub Profile
@sheltonial
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:
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;
You can’t perform that action at this time.