Skip to content

Instantly share code, notes, and snippets.

View mohammedri's full-sized avatar
:shipit:

Mohammed Ridwanul mohammedri

:shipit:
View GitHub Profile
@mohammedri
mohammedri / gist:7d8060819ab8c396c012
Created February 16, 2016 01:50 — forked from 1Marc/gist:4770184
Pseudocode demonstrating debouncing.
// Pseudocode to demonstrate debouncing
$(".item_column").on("scroll", function(){
// this function fires way too fast
getItemsInView();
});
// With debouncing:
$(".item_column").on("scroll", _.debounce(function(){
// max this function can fire is every 150 milliseconds
getItemsInView();