aboutsummaryrefslogtreecommitdiffstats
path: root/app/component.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-08-03 22:11:15 +0000
committers-ol <s-ol@users.noreply.github.com>2018-08-03 22:11:15 +0000
commitf8d89aee2d5ce87380aaf3b985ae28759ff3abb9 (patch)
treedae5bc9300cec89b24c6be75aa8494f1e23af0e2 /app/component.moon
parentadd play-tags (diff)
downloadmmm-f8d89aee2d5ce87380aaf3b985ae28759ff3abb9.tar.gz
mmm-f8d89aee2d5ce87380aaf3b985ae28759ff3abb9.zip
add \transform to reactivevar
Diffstat (limited to 'app/component.moon')
-rw-r--r--app/component.moon4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/component.moon b/app/component.moon
index fc29f8c..4f1d0c0 100644
--- a/app/component.moon
+++ b/app/component.moon
@@ -1,5 +1,7 @@
{ :document } = js.global
+warn = warn or -> print
+
-- convert anything to a DOM Node
-- val must be one of:
-- * DOM Node (instanceof window.Node)
@@ -39,6 +41,8 @@ class ReactiveVar
get: => @value
+ transform: (transform) => @set transform @get!
+
subscribe: (callback) =>
with -> @listeners[callback] = nil
@listeners[callback] = callback