Open
Description
hi, I'm using the filter callback to filter messages, though that callback has a MessageEvent
as argument, so I need to JSON.parse
the message before applying the filter:
const filter = (msg: MessageEvent) => {
const { type } = JSON.parse(msg.data)
return type === topic
}
then later I use the lastJsonMessage
hook property so I guess I parse the message twice... is there another solution to avoid a double parse?
Metadata
Metadata
Assignees
Labels
No labels