Add missing example

This commit is contained in:
Daniel Imms
2023-03-27 06:43:00 -07:00
parent 2bff3665ae
commit 5443eb8a8f
+4
View File
@@ -372,6 +372,10 @@ export namespace Event {
*
* @example
* ```
* // Start accumulating events, when the first listener is attached, flush
* // the event after a timeout such that multiple listeners attached before
* // the timeout would receive the event
* this.onInstallExtension = Event.buffer(service.onInstallExtension, true);
* ```
*/
export function buffer<T>(event: Event<T>, flushAfterTimeout = false, _buffer: T[] = []): Event<T> {