Socket
Book a DemoInstallSign in
Socket

util_debounce_throttle

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

util_debounce_throttle

debounce throttle helper function in node & browser

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

util_debounce_throttle Build Status

debounce throttle helper function in node & browser

Usage:

var _debounce = require('util_debounce_throttle')._debounce
var _throttle = require('util_debounce_throttle')._throttle


//send user mousemove data per 100ms
var sendData = function( evt ){ /* here send user event data when mousemove */ }
var _sendData = _throttle( sendData , 100 )
document.onmousemove = _sendData


//send user click data when user not click after 3000ms
var sendData = function( evt ){ /* here send user event data when mousemove */ }
var _sendData = _debounce( sendData , 3000 )
document.click = _sendData

About the test

This lib tested with SINON.JS

Keywords

debounce

FAQs

Package last updated on 22 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts