aboutsummaryrefslogtreecommitdiffstats
path: root/lib/component.server.moon
diff options
context:
space:
mode:
Diffstat (limited to 'lib/component.server.moon')
-rw-r--r--lib/component.server.moon8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/component.server.moon b/lib/component.server.moon
index 456ca71..54bb15c 100644
--- a/lib/component.server.moon
+++ b/lib/component.server.moon
@@ -1,3 +1,5 @@
+import opairs from require 'lib.ordered'
+
-- convert anything to HTML string
-- val must be one of:
-- * MMMElement (have a .render method that returns a string)
@@ -69,7 +71,7 @@ class ReactiveElement
set: (attr, value) =>
if attr == 'style' and 'table' == type value
- for k,v in pairs value
+ for k,v in opairs value
@attrs.style[k] = v
return
@@ -88,10 +90,10 @@ class ReactiveElement
render: =>
b = "<#{@element}"
- for k,v in pairs @attrs
+ for k,v in opairs @attrs
if 'table' == type v
tmp = ''
- for kk, vv in pairs v
+ for kk, vv in opairs v
tmp ..= "#{kk}: #{vv}; "
v = tmp
b ..= " #{k}=\"#{v}\""