Reactive expressions: auto-wrap deref-containing exprs in computed signals
Added contains-deref? predicate to adapter-dom.sx. When rendering a text expression that contains (deref ...) inside an island scope, the adapter now wraps it in (reactive-text (computed (fn () (eval-expr expr env)))). This tracks signal dependencies through arbitrary expressions like (str (deref celsius) "°C") and (+ (* (deref celsius) 1.8) 32). Previously only bare (deref sig) was reactive. Now compound expressions like string interpolation and arithmetic over signals update in real time. The temperature converter preview in sx-tools is fully reactive: clicking +5/-5 updates both °C and °F displays live. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
1372
web/adapter-dom.sx
1372
web/adapter-dom.sx
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user