Created
March 2, 2016 09:26
-
-
Save masakielastic/303f012e94d2d0b57889 to your computer and use it in GitHub Desktop.
Hello World
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/a/14947838/531320 | |
const fromId = document.getElementById.bind(document); | |
const snabbdom = require('snabbdom'); | |
const patch = snabbdom.init([ | |
require('snabbdom/modules/class'), | |
require('snabbdom/modules/props'), | |
require('snabbdom/modules/style'), | |
require('snabbdom/modules/eventlisteners'), | |
]); | |
const h = require('snabbdom/h'); | |
const { div, p } = require('hyperscript-helpers')(h); | |
const Model = { | |
message: 'Hello World' | |
}; | |
var newVnode = div([ | |
p(Model.message) | |
]); | |
var oldVnode = fromId('container'); | |
oldVnode = patch(oldVnode, newVnode); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment