Island disposal, reactive lists, input binding, and Phase 2 plan
- Effect and computed auto-register disposers with island scope via register-in-scope; dispose-islands-in called before every swap point (orchestration.sx) to clean up intervals/subscriptions on navigation. - Map + deref inside islands auto-upgrades to reactive-list for signal- bound list rendering. Demo island with add/remove items. - New :bind attribute for two-way signal-input binding (text, checkbox, radio, textarea, select). bind-input in adapter-dom.sx handles both signal→element (effect) and element→signal (event listener). - Phase 2 plan page at /reactive-islands/phase2 covering input binding, keyed reconciliation, reactive class/style, refs, portals, error boundaries, suspense, and transitions. - Updated status tables in overview and plan pages. - Fixed stopwatch reset (fn body needs do wrapper for multiple exprs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,8 @@
|
||||
|
||||
;; Initial computation
|
||||
(recompute)
|
||||
;; Auto-register disposal with island scope
|
||||
(register-in-scope (fn () (dispose-computed s)))
|
||||
s))))
|
||||
|
||||
|
||||
@@ -176,13 +178,17 @@
|
||||
(run-effect)
|
||||
|
||||
;; Return dispose function
|
||||
(fn ()
|
||||
(set! disposed true)
|
||||
(when cleanup-fn (invoke cleanup-fn))
|
||||
(for-each
|
||||
(fn (dep) (signal-remove-sub! dep run-effect))
|
||||
deps)
|
||||
(set! deps (list)))))))
|
||||
(let ((dispose-fn
|
||||
(fn ()
|
||||
(set! disposed true)
|
||||
(when cleanup-fn (invoke cleanup-fn))
|
||||
(for-each
|
||||
(fn (dep) (signal-remove-sub! dep run-effect))
|
||||
deps)
|
||||
(set! deps (list)))))
|
||||
;; Auto-register with island scope so disposal happens on swap
|
||||
(register-in-scope dispose-fn)
|
||||
dispose-fn)))))
|
||||
|
||||
|
||||
;; --------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user