Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-hook/throttle

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-hook/throttle - npm Package Compare versions

Comparing version 0.1.6 to 1.0.0

20

dist/cjs/index.js

@@ -33,8 +33,12 @@ 'use strict'

function _ref() {
nextTimeout.current !== null &&
(0, _requestTimeout.clearRequestTimeout)(nextTimeout.current)
tailTimeout.current !== null &&
(0, _requestTimeout.clearRequestTimeout)(tailTimeout.current)
nextTimeout.current = null
tailTimeout.current = null
if (nextTimeout.current !== null) {
;(0, _requestTimeout.clearRequestTimeout)(nextTimeout.current)
nextTimeout.current = null
}
if (tailTimeout.current !== null) {
;(0, _requestTimeout.clearRequestTimeout)(tailTimeout.current)
tailTimeout.current = null
}
calledLeading.current = false

@@ -61,5 +65,5 @@ }

calledLeading.current = true
} else {
nextTimeout.current = (0, _requestTimeout.requestTimeout)(_ref2, wait)
}
nextTimeout.current = (0, _requestTimeout.requestTimeout)(_ref2, wait)
} else {

@@ -66,0 +70,0 @@ tailTimeout.current !== null &&

18

dist/es/index.js

@@ -26,6 +26,12 @@ import {useEffect, useCallback, useState, useRef} from 'react'

function _ref() {
nextTimeout.current !== null && clearRequestTimeout(nextTimeout.current)
tailTimeout.current !== null && clearRequestTimeout(tailTimeout.current)
nextTimeout.current = null
tailTimeout.current = null
if (nextTimeout.current !== null) {
clearRequestTimeout(nextTimeout.current)
nextTimeout.current = null
}
if (tailTimeout.current !== null) {
clearRequestTimeout(tailTimeout.current)
tailTimeout.current = null
}
calledLeading.current = false

@@ -52,5 +58,5 @@ }

calledLeading.current = true
} else {
nextTimeout.current = requestTimeout(_ref2, wait)
}
nextTimeout.current = requestTimeout(_ref2, wait)
} else {

@@ -57,0 +63,0 @@ tailTimeout.current !== null && clearRequestTimeout(tailTimeout.current)

{
"name": "@react-hook/throttle",
"version": "0.1.6",
"version": "1.0.0",
"main": "dist/cjs/index.js",

@@ -5,0 +5,0 @@ "author": "Jared Lunde <jared@BeStellar.co> (https://BeStellar.co)",

@@ -33,6 +33,12 @@ import {useEffect, useCallback, useState, useRef} from 'react'

() => () => {
nextTimeout.current !== null && clearRequestTimeout(nextTimeout.current)
tailTimeout.current !== null && clearRequestTimeout(tailTimeout.current)
nextTimeout.current = null
tailTimeout.current = null
if (nextTimeout.current !== null) {
clearRequestTimeout(nextTimeout.current)
nextTimeout.current = null
}
if (tailTimeout.current !== null) {
clearRequestTimeout(tailTimeout.current)
tailTimeout.current = null
}
calledLeading.current = false

@@ -53,4 +59,5 @@ },

}
nextTimeout.current = requestTimeout(() => next(this_, args), wait)
else {
nextTimeout.current = requestTimeout(() => next(this_, args), wait)
}
}

@@ -57,0 +64,0 @@ else {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc