Last active
October 2, 2021 11:28
-
-
Save travist/057e613adbcd31510d6e110786d88e10 to your computer and use it in GitHub Desktop.
Revisions
-
travist revised this gist
Oct 30, 2016 . No changes.There are no files selected for viewing
-
travist revised this gist
Oct 30, 2016 . No changes.There are no files selected for viewing
-
travist revised this gist
Oct 30, 2016 . 1 changed file with 13 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,17 @@ ['$scope', function($scope) { var debounce = function(cb) { var timeout = null; return function(data) { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(function() { cb(data); }, 200); }; }; $scope.$watch('submission.data', debounce(function(data) { // Put your logic here.... })); }); -
travist created this gist
Oct 18, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ ['$scope', function($scope) { var debounceTimer = null; var debounce = function(cb) { if (debounceTimer) clearTimeout(debounceTimer); debounceTimer = setTimeout(cb, 200); }; $scope.$watch('submission.data', function(data) { debounce(function() { // Put your logic here... }); }); });