TriggerReadablePort
Interface
Section titled “Interface”export interface TriggerReadablePort extends SnapshotPort { readonly trigger: 0 | 1;}PURPOSE
Section titled “PURPOSE”A port expressing a one-time event trigger.
Unlike GateReadablePort, it is expected to become 1 only once when an event occurs, then return to 0 at the next snapshot.
Used as a trigger for state changes such as window resize events.
| Property | Description |
|---|---|
trigger | 1 while firing, 0 when not firing |
Must inherit from SnapshotPort.
When snapshot() is called, the port must capture the value at that moment and maintain it internally, ensuring that trigger does not change until the next snapshot().
It is expected that trigger becomes 1 in the snapshot() call when the event occurs, and returns to 0 at the next snapshot().