diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-07-11 22:37:51 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-07-11 22:39:43 +0000 |
| commit | dacc8296bc2cea87a726a71ef15baa26e9176c4e (patch) | |
| tree | b08fba410917e208f718329dfadff6a7247c66cb | |
| parent | update realities.moon (diff) | |
| download | mmm-dacc8296bc2cea87a726a71ef15baa26e9176c4e.tar.gz mmm-dacc8296bc2cea87a726a71ef15baa26e9176c4e.zip | |
towards env-agnostic component.moon
| -rw-r--r-- | app/component.moon | 2 | ||||
| -rw-r--r-- | app/todo.moon | 7 | ||||
| m--------- | dist | 0 |
3 files changed, 4 insertions, 5 deletions
diff --git a/app/component.moon b/app/component.moon index f0bc77f..fc29f8c 100644 --- a/app/component.moon +++ b/app/component.moon @@ -95,7 +95,7 @@ class ReactiveElement table.insert @_subscriptions, child\subscribe (...) -> @append ... child = child\get! if 'string' == type child - print 'WARN: string from ReactiveVar implicitly converted to TextNode, updating may fail' + warn 'string from ReactiveVar implicitly converted to TextNode, updating may fail' child = asnode child ok, last = pcall asnode, last diff --git a/app/todo.moon b/app/todo.moon index a464d0d..5bf4fef 100644 --- a/app/todo.moon +++ b/app/todo.moon @@ -1,5 +1,4 @@ -{ :document } = js.global -import ReactiveVar, text, div, form, span, h3, a, input, textarea, button from require './component.moon' +import ReactiveVar, append, text, div, form, span, h3, a, input, textarea, button from require './component.moon' parent = div! todoItem = (desc, done) -> @@ -30,5 +29,5 @@ form = with form { \append input type: 'text', value: desc, onchange: (e) => desc\set e.target.value \append input type: 'submit', value: 'add' -document.body\appendChild parent.node -document.body\appendChild form.node +append parent +append form diff --git a/dist b/dist -Subproject 6462cfe7581ed71780de1b5572192de85b07afe +Subproject f0700a9c142f4bd1f8404e6977e01c82e0ded24 |
