KeKs0r / mqtt-react

React container for MQTT
47 stars 31 forks source link

Improved getting topic data in element props.data only for subscribed topics. #14

Open nmengers opened 4 years ago

nmengers commented 4 years ago

I really like this react component but there was one thing that felt a bit odd when using this framework.

When I subscribe an element to a certain topic this element would also get all the data from the topics it was not subscribed to and since there is no way in telling from what topic the data was comming from it really confused me.

So with this pull request I let the message event only forward to the handler when this element is subscribed to this topic.