useWebSocketTopic
Hold one or more topic subscriptions while the component is mounted.
Usage
Parameters
Behavior
- Shared. Components holding the same topic share one subscription.
- Follows changes. Changing
topicsubscribes to the new one and unsubscribes from the old one. A new array with the same topics changes nothing. - StrictMode-safe. StrictMode's double mount doesn't send an extra
unsubscribe/subscribepair. - Holds the connection while mounted.