Pure functions to handle messages coming from the Polymarket websocket.
Summary
Functions
Handles an event from the websocket.
Functions
@spec handle_message(map(), Polymarket.WebSocket.t()) :: {:reply, {:text, String.t()}, Polymarket.WebSocket.t()} | {:noreply, Polymarket.WebSocket.t()}
Handles an event from the websocket.
Decodes the event into a struct if possible, then forwards it to the handler
module injected into the websocket state (state.handler). Prints a warning
if the event is undecodable.