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
/** | |
* Assigns to a given base object on the provided path the value. | |
* | |
* @example | |
* assign({}, 'consent.advertising', true) = { | |
* value: true, | |
* updatedAt: Date.now() | |
* } | |
* @param obj {Object} - Base object that will hold the value. | |
* @param path {string} - Path to be created, if non existent, on the base object. Format is § string using the dot notation. |
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
interface Consumer<T> { | |
(...data: T[]): void | |
} | |
type Listener<T> = Consumer<T> | |
export interface Emittable<T> { | |
/** | |
* Removes all listeners and all events. | |
*/ |