xesite/frontend/support/index.js

14 lines
405 B
JavaScript
Raw Normal View History

2016-12-14 07:11:20 +00:00
var Main = require('../src/Main.purs');
var initialState = require('../src/Layout.purs').init;
var debug = process.env.NODE_ENV === 'development'
if (module.hot) {
var app = Main[debug ? 'debug' : 'main'](window.puxLastState || initialState)();
app.state.subscribe(function (state) {
window.puxLastState = state;
});
module.hot.accept();
} else {
Main[debug ? 'debug' : 'main'](initialState)();
}