resize-scroll-handler
web-sparkle.
A package withinNo more long frames. Stop repainting the browser all the time, and only fire window events once.
Usage
$ npm install resize-scroll-handler
const ResizeScrollHandler = const handler = // Add as many callbacks as you want without performing unnecessary// browser reflows or taking up extra memory. Woohoo! handlerhandlerhandler... handlerhandlerhandler... handlerhandler
Reference
ResizeScrollHandler.requestResize()
Trigger all the resize handlers.
ResizeScrollHandler.requestSCroll()
Trigger all the scroll handlers.
ResizeScrollHandler.addToHandler(type, fn)
Add an event handler.
Params
- type
String
- Either 'resize' or 'scroll'. - fn
Function
- The function you'd like to add on to the event handler.
Development
To run the example locally, run the following commands:
npm installnpm run devnpm start
Credits
This readme is maintained by hello@christinecha.com.
License
MIT