UNPKG

@pexip/signal

Version:

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

13 lines (10 loc) 595 B
```ts type BatchedSignalOptions = object & BaseSignalOptions; ``` ## Type Declaration | Name | Type | Description | | ------ | ------ | ------ | | `variant` | `"batched"` | Batched signal variant | | `bufferSize?` | `number` | Specify the buffer size for `replay` type signal | | `emitImmediatelyWhenFull?` | `boolean` | Emit the signal immediately when the buffer is full and disgard the scheduled function to avoid losing data. | | `schedule()` | (`callback`) => `void` | Scheduler used for batching **Example** `const scheduler = (callback: () => void) => { setTimeout(callback, 50); };` |