lib/heartml/server_effects.rb in heartml-1.0.0.beta9 vs lib/heartml/server_effects.rb in heartml-1.0.0.beta10
- old
+ new
@@ -52,9 +52,13 @@
directive :classMap, ->(_, node, obj) {
obj.each do |k, v|
node.add_class k.to_s if v
end
}
+
+ directive :attribute, ->(_, node, name, value) {
+ node[name] = value
+ }
end
end
def _server_effect_binding(attribute:, node:)
_iso_effect_binding(attribute:, node:)