Skip to main content
Version: v8.0.0

DeliveryControllerType

The object a delivery strategy returns for a single listen() subscription.

Think of it as a tiny pipe: push is the input (every raw message lands here), deliver from the

DeliveryStrategyContextType is the output, and dispose is the cleanup.


Import
import { DeliveryControllerType } from "@hyper-fetch/sockets"

Preview​

type DeliveryControllerType<Input,Extra> = {
dispose: () => void;
push: (message: DeliveryMessageType<Input, Extra>) => void;
}

Structure​

DeliveryControllerType
NameTypeDescription
dispose
() => void

Called when the subscription ends ( unlisten() / component unmount). Clear timers and drop pending state here. Nothing may be delivered after dispose was called. Must be safe to call more than once.

push
(message: DeliveryMessageType<Input, Extra>) => void

Receives every raw message of the subscription. The strategy decides if and when to call deliver .