Closed SilentCicero closed 8 years ago
This is because onupdate
isn't set on app2
. Hooks are removed like any other property if they don't exist on the element being morphed to. Try:
var yo = require("yo-yo")
var hooks = require("morphdom-hooks")
var update = hooks(yo.update)
var app = yo`<div>One</div>`
var app2 = yo`<div>Two!</div>`
app.onupdate = onupdate
app2.onupdate = onupdate
update(app, app2)
document.body.appendChild(app)
function onupdate (node) {
console.log(node)
}
Things doesn't seem to fly: