Visualize clients going offline + Add mqtt connection details to config
This commit is contained in:
parent
b2f1e2b07c
commit
964e3c0305
4 changed files with 13 additions and 3 deletions
|
|
@ -89,4 +89,4 @@ store.subscribe(() => ReactDOM.render(<App state={store.getState()} />, document
|
|||
|
||||
store.dispatch({type:null});
|
||||
|
||||
connectMqtt("ws://172.22.36.207:1884", store);
|
||||
connectMqtt(Config.space.mqtt, store);
|
||||
|
|
|
|||
|
|
@ -23,4 +23,13 @@ export default function connectMqtt(url: string, store: Store<*,*>) {
|
|||
}
|
||||
});
|
||||
});
|
||||
client.on("offline", () => {
|
||||
store.dispatch({ type: null });
|
||||
});
|
||||
client.on("close", () => {
|
||||
store.dispatch({ type: null });
|
||||
});
|
||||
client.on("reconnect", () => {
|
||||
store.dispatch({ type: null });
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue