UNPKG

@pexip/signal

Version:

an observer pattern while avoiding boilerplate code. https://en.wikipedia.org/wiki/Signals_and_slots

84 lines (50 loc) 842 B
Buffer to hold the signal subject ## Extends - `Iterable`\<`T`\> ## Type Parameters | Type Parameter | | ------ | | `T` | ## Properties | Property | Modifier | Type | | ------ | ------ | ------ | | <a id="size"></a> `size` | `readonly` | `number` | ## Methods ### add() ```ts add(value): void; ``` Add value to buffer #### Parameters | Parameter | Type | | ------ | ------ | | `value` | `T` | #### Returns `void` *** ### clear() ```ts clear(): void; ``` clear the buffer #### Returns `void` *** ### entries() ```ts entries(): ArrayIterator<[number, T]>; ``` #### Returns `ArrayIterator`\<\[`number`, `T`\]\> the current buffered values as an array *** ### \[iterator\]() ```ts iterator: Iterator<T, any, any>; ``` #### Returns `Iterator`\<`T`, `any`, `any`\> #### Inherited from ```ts Iterable.[iterator] ```