Skip to content

Throttled scroll and resize event via requestAnimationFrame.

Notifications You must be signed in to change notification settings

mnmly/throttled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

throttled

Throttled scroll and resize event via requestAnimationFrame.

Based on this article

Installation

Install with component(1):

$ component install mnmly/throttled

Usage

var Throttled = require('throttled');
var throttled = new Throttled(); // Probably better to be used as singleton.

throttled.on('scroll', function(){
  console.log('clean scroll');
});

throttled.on('resize', function(){
  console.log('clean resize');
});


// If you don't want this anymore.
throttled.destroy();

Todo

  • Allow attatching scroll event other than window

License

MIT

About

Throttled scroll and resize event via requestAnimationFrame.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published