toString: support rehydration

This commit is contained in:
Yoshua Wuyts
2016-05-24 02:10:17 +09:00
parent 80dca262ad
commit 60665f2a71
8 changed files with 159 additions and 33 deletions
+9 -2
View File
@@ -4,6 +4,14 @@ const mainView = require('./views/main')
const app = choo()
app.model({
namespace: 'message',
state: {
server: 'rehydration has kicked in, server data was tossed',
client: 'hello client!'
}
})
app.router((route) => [
route('/', mainView)
])
@@ -11,6 +19,5 @@ app.router((route) => [
if (module.parent) {
module.exports = app
} else {
const tree = app.start()
document.body.appendChild(tree)
app.start('#app-root')
}