aboutsummaryrefslogtreecommitdiffstats
path: root/lib/component.server.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-11-01 08:07:40 +0000
committers-ol <s-ol@users.noreply.github.com>2018-11-01 08:07:40 +0000
commit29d2b615dafa6f3a54910b72d303f74a97c4d822 (patch)
tree7ba2e8bdbb94d9704bc2065cb87de99304f92fdd /lib/component.server.moon
parentsmooth navigation (diff)
downloadmmm-29d2b615dafa6f3a54910b72d303f74a97c4d822.tar.gz
mmm-29d2b615dafa6f3a54910b72d303f74a97c4d822.zip
component get_or_create
Diffstat (limited to 'lib/component.server.moon')
-rw-r--r--lib/component.server.moon5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/component.server.moon b/lib/component.server.moon
index 85d97eb..d717ff7 100644
--- a/lib/component.server.moon
+++ b/lib/component.server.moon
@@ -105,9 +105,14 @@ elements = setmetatable {}, __index: (name) =>
with val = (...) -> ReactiveElement name, ...
@[name] = val
+get_or_create = (elem, id, ...) ->
+ with ReactiveElement elem, ...
+ \set 'id', id
+
{
:ReactiveVar,
:ReactiveElement,
+ :get_or_create,
:tohtml,
:flush,
:append,