2017-05-02 20:03:48 -06:00
|
|
|
import * as React from "react";
|
|
|
|
import * as ReactDOM from "react-dom";
|
2017-05-03 16:12:51 -06:00
|
|
|
import { AppContainer } from "react-hot-loader";
|
2017-05-02 20:03:48 -06:00
|
|
|
|
2017-06-20 08:45:25 -06:00
|
|
|
import App from "./components/App";
|
2017-05-03 16:12:51 -06:00
|
|
|
import { MqttApiClient } from "./mqtt";
|
2017-05-30 16:45:25 -06:00
|
|
|
import {Message, UiStore} from "./ui";
|
2017-05-02 20:03:48 -06:00
|
|
|
|
|
|
|
const client = new MqttApiClient();
|
|
|
|
client.start();
|
|
|
|
const device = client.getDevice("grinklers");
|
2017-05-30 16:45:25 -06:00
|
|
|
const uiStore = new UiStore();
|
|
|
|
uiStore.addMessage(new Message("asdf", "boo!", Message.Type.Error));
|
2017-05-02 20:03:48 -06:00
|
|
|
|
2017-05-04 13:35:33 -06:00
|
|
|
const rootElem = document.getElementById("app");
|
2017-05-02 20:03:48 -06:00
|
|
|
|
2017-05-03 16:12:51 -06:00
|
|
|
ReactDOM.render(<AppContainer>
|
2017-05-30 16:45:25 -06:00
|
|
|
<App device={device} uiStore={uiStore} />
|
2017-05-03 16:12:51 -06:00
|
|
|
</AppContainer>, rootElem);
|
|
|
|
|
|
|
|
if (module.hot) {
|
2017-06-20 08:45:25 -06:00
|
|
|
module.hot.accept("./components/App", () => {
|
|
|
|
const NextApp = require<any>("./components/App").default;
|
2017-05-03 16:12:51 -06:00
|
|
|
ReactDOM.render(<AppContainer>
|
2017-05-30 16:45:25 -06:00
|
|
|
<App device={device} uiStore={uiStore} />
|
2017-05-03 16:12:51 -06:00
|
|
|
</AppContainer>, rootElem);
|
2017-05-06 15:39:25 -06:00
|
|
|
});
|
|
|
|
}
|