Skip to content

Instantly share code, notes, and snippets.

View patrick-mcdougle's full-sized avatar
🙃
Probably Thinking About Code

Patrick McDougle patrick-mcdougle

🙃
Probably Thinking About Code
View GitHub Profile
@simmo
simmo / throttle.js
Last active November 9, 2022 10:28
JavaScript Throttle using requestAnimationFrame
function throttle(type, name, obj) {
var running = false;
obj = obj || window;
var func = function() {
if (running) return;
running = true;