raf-throttle
Advanced tools
Comparing version 2.0.5 to 2.0.6
## [HEAD] | ||
## The CHANGELOG after v2.0.4 is moved to [the Github release page](https://github.com/wuct/raf-throttle/releases). | ||
[HEAD]: https://github.com/wuct/raf-throttle/compare/latest...HEAD | ||
@@ -4,0 +6,0 @@ |
@@ -6,3 +6,2 @@ 'use strict'; | ||
var lastArgs; | ||
var later = function later(context) { | ||
@@ -14,3 +13,2 @@ return function () { | ||
}; | ||
var throttled = function throttled() { | ||
@@ -20,5 +18,3 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
} | ||
lastArgs = args; | ||
if (requestId === null) { | ||
@@ -28,3 +24,2 @@ requestId = requestAnimationFrame(later(this)); | ||
}; | ||
throttled.cancel = function () { | ||
@@ -34,3 +29,2 @@ cancelAnimationFrame(requestId); | ||
}; | ||
return throttled; | ||
@@ -37,0 +31,0 @@ }; |
{ | ||
"name": "raf-throttle", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Throttle a function by requestAnimationFrame", | ||
"main": "lib/rafThrottle.js", | ||
"types": "index.d.ts", | ||
"scripts": { | ||
@@ -32,13 +33,13 @@ "test": "jest --coverage", | ||
"devDependencies": { | ||
"@babel/cli": "7.11.6", | ||
"@babel/core": "7.11.6", | ||
"@babel/preset-env": "7.11.5", | ||
"babel-jest": "26.3.0", | ||
"codecov": "3.7.2", | ||
"jest": "26.4.2", | ||
"@babel/cli": "7.19.3", | ||
"@babel/core": "7.20.5", | ||
"@babel/preset-env": "7.20.2", | ||
"babel-jest": "27.0.2", | ||
"codecov": "3.8.2", | ||
"jest": "27.0.4", | ||
"raf": "3.4.1", | ||
"rollup": "2.26.11", | ||
"rollup": "3.7.2", | ||
"rollup-plugin-babel": "4.4.0", | ||
"uglify-js": "3.10.4", | ||
"semantic-release": "17.1.1" | ||
"uglify-js": "3.17.4", | ||
"semantic-release": "19.0.5" | ||
}, | ||
@@ -45,0 +46,0 @@ "jest": { |
@@ -5,3 +5,3 @@ (function (global, factory) { | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.rafThrottle = factory()); | ||
}(this, (function () { 'use strict'; | ||
})(this, (function () { 'use strict'; | ||
@@ -11,3 +11,2 @@ var rafThrottle = function rafThrottle(callback) { | ||
var lastArgs; | ||
var later = function later(context) { | ||
@@ -19,3 +18,2 @@ return function () { | ||
}; | ||
var throttled = function throttled() { | ||
@@ -25,5 +23,3 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
} | ||
lastArgs = args; | ||
if (requestId === null) { | ||
@@ -33,3 +29,2 @@ requestId = requestAnimationFrame(later(this)); | ||
}; | ||
throttled.cancel = function () { | ||
@@ -39,3 +34,2 @@ cancelAnimationFrame(requestId); | ||
}; | ||
return throttled; | ||
@@ -46,2 +40,2 @@ }; | ||
}))); | ||
})); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11054
11
130
0