Skip to content

Instantly share code, notes, and snippets.

View mattosborn's full-sized avatar

Matt Osborn mattosborn

View GitHub Profile
@mattosborn
mattosborn / debounce.js
Created November 12, 2015 13:40 — forked from danprince/debounce.js
Debounce
function debounce(fn, interval) {
var lastCall;
return function() {
var now = Date.now();
if(!lastCall || now - lastCall > interval) {
fn.apply(this, arguments);
lastCall = now;
}