@dialstack/sdk / server / ParkSlotSubscriptionHandlers
Interface: ParkSlotSubscriptionHandlers
Defined in: sdk/server/src/index.ts:2091
Handlers for a park-slot subscription. All optional.
Properties
onError?
optional onError?: (error) => void;
Defined in: sdk/server/src/index.ts:2106
Transport or parse failure. The subscription is no longer live.
Parameters
error
Error
Returns
void
onSlot?
optional onSlot?: (slot) => void;
Defined in: sdk/server/src/index.ts:2098
One slot's new state. It supersedes what you had; there is no history.
Parameters
slot
Returns
void
onSnapshot?
optional onSnapshot?: (slots) => void;
Defined in: sdk/server/src/index.ts:2096
Every slot's current state, delivered on connect and again after every reconnect. Replace whatever you had wholesale rather than merging.
Parameters
slots
Returns
void
onTerminated?
optional onTerminated?: (reason) => void;
Defined in: sdk/server/src/index.ts:2104
The server ended the subscription and a reconnect is needed — reason is
why. Recovery is the same in every case: reconnect and take the fresh
snapshot. Not called when you close the subscription yourself.
Parameters
reason
string
Returns
void