Skip to content

Commit

Permalink
enhancement(Utils) eslint coding standards fixes no unsafe function t…
Browse files Browse the repository at this point in the history
  • Loading branch information
gselderslaghs committed Dec 19, 2024
1 parent eb347bb commit e023654
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,12 @@ export class Utils {
* @param wait Wait time.
* @param options Additional options.
*/
static throttle(func: Function, wait: number, options: Partial<{leading:boolean,trailing:boolean}> = null) {
let context: object, args: IArguments, result: any;
let timeout = null;
let previous = 0;
options || (options = {});
static throttle(func: (Function: object) => void, wait: number, options: Partial<{leading:boolean,trailing:boolean}> = {}) {
let context: object,
args: IArguments,
result,
timeout = null,
previous = 0;
const later = function() {
previous = options.leading === false ? 0 : new Date().getTime();
timeout = null;
Expand Down

0 comments on commit e023654

Please sign in to comment.