This file contains 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
export class Debouncer { | |
public promiseGenerator: () => Promise; | |
public delayInMilliseconds: number; | |
private timeoutCompleted: bool; | |
private timeoutCached: () => void; | |
constructor (generator: () => Promise, delayInMilliseconds: number) { | |
this.promiseGenerator = generator; |
This file contains 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
/** | |
* Spread an object into a Map of properties and their values, so that | |
* you can call Map.values or Map.keys to spread as needed. | |
* | |
* @name Spreader | |
* @example Spreader({userName: 'soas'}, '*'); | |
* @param {Object} object Object to spread. | |
* @param {String|Array.<String>} [allowed='*'] Properties to allow. | |
* @returns {Map<String, Object>} Values in the object by properties. | |
*/ |