This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** Callback to inform of a value updates. */ | |
| type Subscriber<T> = (value: T) => void | |
| /** Unsubscribes from value updates. */ | |
| type Unsubscriber = () => void | |
| /** A store that can be subscribed */ | |
| interface Subscribable<T> { | |
| subscribe: (run: Subscriber<T>) => Unsubscriber | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function debounce(fn, wait) { | |
| let t | |
| return function () { | |
| clearTimeout(t) | |
| t = setTimeout(() => fn.apply(this, arguments), wait) | |
| } | |
| } |
NewerOlder