createDeliveryController
Instantiates a delivery controller for one
listen()
subscription.
Import
import { createDeliveryController } from "@hyper-fetch/sockets"
Source
Package
Parameters
createDeliveryController<Input, Output, Extra>(delivery: DeliveryPresetType | DeliveryStrategyType<Input, any, Extra>, context: DeliveryStrategyContextType<Output, Extra>)
Parameters
| Name | Type | Description |
|---|---|---|
| delivery | | |
| context | |
Returns
type DeliveryControllerType<Input,Extra> = {
dispose: () => void;
push: (message: DeliveryMessageType<Input, Extra>) => void;
}
createDeliveryController
| Name | Type | Description |
|---|---|---|
| dispose | | Called when the subscription ends (
|
| push | | Receives every raw message of the subscription. The strategy decides if and when to call
|
