You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have successfully implemented the package and love it. Great work.
Right now I have stored the client object in the local store as shown in the example but when I try to store the object in the REDUX store I get only an empty object.
Where setMQTTClient() is the action that invokes the reducer to write it to the client to the store.
Since I'm getting an empty object I'm wondering whether the client creation is Promised based. If yes, how can I hook on the callback so that I can save the entire object once it has been created.
The text was updated successfully, but these errors were encountered:
There is not quite enough information to look into your problem.
But my recommendation is if you'd like to manage the mqtt client object with redux, then it should be created and destroyed in a redux action creator as well, such that React components don't have to access MQTT-related code directly at all.
If you could provide at least your reducer and action creator, maybe I could try to help.
While storing connected mqtt client to redux, its always a good idea to inject the client object to the redux store via middleware, and this feature is out of scope for this project as I guess. So I write a middleware to solve this issue, please have a look at this - https://www.npmjs.com/package/redux-mqtt
This middleware works well with this package to store mqtt client.
Hi there,
I have successfully implemented the package and love it. Great work.
Right now I have stored the client object in the local store as shown in the example but when I try to store the object in the REDUX store I get only an empty object.
Here a simple example
Where
setMQTTClient()
is the action that invokes the reducer to write it to theclient
to the store.Since I'm getting an empty object I'm wondering whether the client creation is Promised based. If yes, how can I hook on the callback so that I can save the entire object once it has been created.
The text was updated successfully, but these errors were encountered: