don't copy state anymore

This commit is contained in:
Leo Horie 2016-07-08 00:40:52 -04:00
parent 40ff3c89b5
commit cece44d4ac
4 changed files with 8 additions and 42 deletions

View file

@ -19,7 +19,9 @@ h1,h2,h3,h4,h5,h6,p {margin:0 0 10px;}
var m = require("../../mithril")
var Editor = {
data: "# Markdown Editor\n\nType on the left panel and see the result on the right panel",
oninit: function() {
this.data = "# Markdown Editor\n\nType on the left panel and see the result on the right panel"
},
view: function(vnode) {
return [
m("textarea.editor-input", {oninput: function(e) {vnode.state.data = e.target.value}}, vnode.state.data),