LatestDeliveryType
Sampling delivery. The first message of an idle period is delivered immediately (when
leading
is
true
),
then at most one message per
interval
is delivered - always the most recent one. Intermediate messages
are dropped. Best for state-like data (prices, positions, cursors) where only the newest value matters.
Import
import { LatestDeliveryType } from "@hyper-fetch/sockets"
Source
Package
Preview
type LatestDeliveryType = {
interval: number;
leading?: boolean;
strategy: latest;
}
Structure
LatestDeliveryType
| Name | Type | Description |
|---|---|---|
| interval | | Minimum time in milliseconds between two deliveries. |
| leading | | Deliver the first message of an idle period immediately instead of waiting for the interval to pass. |
| strategy | |
