@elvia/elvis-toolbox
Advanced tools
Comparing version 3.0.0 to 4.0.0
@@ -5,2 +5,17 @@ { | ||
{ | ||
"date": "28.09.22", | ||
"version": "4.0.0", | ||
"changelog": [ | ||
{ | ||
"type": "breaking_changes", | ||
"changes": [ | ||
"Remove function <span class=\"code-text\">throttle</span>, as it is only a re-export of <span class=\"code-text\">lodash.throttle</span>" | ||
], | ||
"fixes": [ | ||
"Add <span class=\"code-text\">lodash.throttle</span> as a dependency and use method <span class=\"code-text\">throttle()</span> directly." | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"date": "15.09.22", | ||
@@ -7,0 +22,0 @@ "version": "3.0.0", |
/** | ||
* Uses lodash throttle function: https://lodash.com/docs/4.17.15#throttle | ||
* | ||
* @param func — The function to throttle. | ||
* @param limit — The number of milliseconds to throttle invocations to. | ||
* @param options — The options object. | ||
* @param options.trailing — Specify invoking on the trailing edge of the timeout. | ||
* @returns Returns the new throttled function. | ||
*/ | ||
export declare const throttle: (func: () => void, limit: number, options?: { | ||
trailing: boolean; | ||
}) => any; | ||
/** | ||
* Starts a listener for mousedown and keydown keyboard events and adds or removes the outline of the element in focus. | ||
@@ -15,0 +3,0 @@ * @param element The element that should be able to obtain an outline. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.warnDeprecatedProps = exports.outlineListener = exports.throttle = void 0; | ||
const lodash_1 = require("lodash"); | ||
exports.warnDeprecatedProps = exports.outlineListener = void 0; | ||
/** | ||
* Uses lodash throttle function: https://lodash.com/docs/4.17.15#throttle | ||
* | ||
* @param func — The function to throttle. | ||
* @param limit — The number of milliseconds to throttle invocations to. | ||
* @param options — The options object. | ||
* @param options.trailing — Specify invoking on the trailing edge of the timeout. | ||
* @returns Returns the new throttled function. | ||
*/ | ||
const throttle = (func, limit, options) => { | ||
return (0, lodash_1.throttle)(func, limit, options); | ||
}; | ||
exports.throttle = throttle; | ||
/** | ||
* Starts a listener for mousedown and keydown keyboard events and adds or removes the outline of the element in focus. | ||
@@ -20,0 +6,0 @@ * @param element The element that should be able to obtain an outline. |
{ | ||
"name": "@elvia/elvis-toolbox", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "", | ||
"license": "MIT", | ||
"author": "", | ||
"main": "./dist/index.js", | ||
"dependencies": { | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.179" | ||
} | ||
"main": "./dist/index.js" | ||
} |
# Toolbox | ||
## Throttle | ||
Basic throttle functionality | ||
`import { throttle } from @elvia/elvis-toolbox;` | ||
`throttle(func, limit)` |
@@ -1,17 +0,2 @@ | ||
import { throttle as lodashThrottle } from 'lodash'; | ||
/** | ||
* Uses lodash throttle function: https://lodash.com/docs/4.17.15#throttle | ||
* | ||
* @param func — The function to throttle. | ||
* @param limit — The number of milliseconds to throttle invocations to. | ||
* @param options — The options object. | ||
* @param options.trailing — Specify invoking on the trailing edge of the timeout. | ||
* @returns Returns the new throttled function. | ||
*/ | ||
export const throttle = (func: () => void, limit: number, options?: { trailing: boolean }): any => { | ||
return lodashThrottle(func, limit, options); | ||
}; | ||
/** | ||
* Starts a listener for mousedown and keydown keyboard events and adds or removes the outline of the element in focus. | ||
@@ -18,0 +3,0 @@ * @param element The element that should be able to obtain an outline. |
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
0
0
41187
1072
2
- Removedlodash@^4.17.21
- Removedlodash@4.17.21(transitive)