VictorHAS / mqtt-react-hooks

ReactJS library for Pub/Sub communication with an MQTT broker using Hooks
MIT License
91 stars 28 forks source link

cant get message of 2 topic at a time #40

Open rahabonyani opened 2 years ago

rahabonyani commented 2 years ago

hi i need to subscribe 2 topics in at a time. so i pass 2 topic in 'useSubscription' with array but i just get message for first topic

for example like this: image const { message } = useSubscription(['topic/1', 'topic/2']);

is this correct? Is it possible to receive message of 2 topics at the same time?

Originally posted by @mehrdad24 in https://github.com/VictorHAS/mqtt-react-hooks/issues/13#issuecomment-1008268732