UNPKG

@figliolia/react-hooks

Version:

A small collection of simple React Hooks you're probably rewriting on a regular basis

22 lines (21 loc) 479 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeferFN = void 0; class DeferFN { constructor(callback, wait) { this.ID = null; this.wait = wait; this.callback = callback; } update(...args) { this.wait = args[1]; this.callback = args[0]; } cancel() { if (this.ID) { clearTimeout(this.ID); this.ID = null; } } } exports.DeferFN = DeferFN;