Skip to content

Function: useMqttAlerts()

useMqttAlerts(subscriptions): void

Defined in: hooks/use-mqtt-alerts.ts:26

Hook for establishing MQTT connection and receiving real-time fire alerts.

Subscribes to topics corresponding to user's zone subscriptions. Parses incoming alert messages (JSON or plain text) and displays as toast notifications. Automatically reconnects on connection loss.

Parameters

Parameter Type Description
subscriptions MapFeature[] | undefined User's active zone subscriptions

Returns

void