useSubscribeByAll
The useSubscribeByAll hook is a wrapper around the useWebSocket hook.
This hook subscribes to all messages from the server.
Returns
The hook returns the following:
messageHistory: an array of all messages received from the serverlastMessage: the last message received from the serverconnectionStatus: the current connection status
Example Usage
const { messageHistory, lastMessage, connectionStatus } = useSubscribeByAll();