site/frontend/support/index.js

26 lines
594 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)();
}
2016-12-18 05:14:25 +00:00
global.main = function(args, callback) {
var body = Main['ssr'](initialState)();
result = {
"app": body,
"uuid": args.uuid,
"title": "Christine Dodrill"
}
callback(result);
};