UNPKG

@atlaskit/tree

Version:

A React Component for displaying expandable and sortable tree hierarchies

15 lines 299 B
export default class DelayedFunction { constructor(delay) { this.delay = delay; } start(fn) { this.stop(); this.timeoutId = window.setTimeout(fn, this.delay); } stop() { if (this.timeoutId) { clearTimeout(this.timeoutId); this.timeoutId = undefined; } } }