dreamstack/examples/compose-search-map.ds
enzotar b0e7de3b2e fix: signal composition — stream derived signals, fix identity check, correct relay routing
- Register derived signals in _signalRegistry so _streamSync includes them
- Auto-sync all signals (source + derived) after flush() recomputes effects
- Fix Object.assign identity check: create new object so signal setter detects changes
- Change _connectStream receiver path from /signal/main to /stream/default
- Initialize stream state with {} instead of null to prevent crashes
- Emit StreamFrom bindings directly without double-wrapping in signal()

Verified: static build shows Count: 9, Doubled: 18 on composition page.
HMR interference with WebSocket connections is a separate issue.
2026-02-25 23:55:05 -08:00

23 lines
589 B
Text

-- Compose Search + Map widgets into one view
--
-- Run with:
-- Tab 1: dreamstack stream examples/widget-search.ds
-- Tab 2: dreamstack stream examples/widget-map.ds --port 9101
-- Tab 3: dreamstack dev examples/compose-search-map.ds --port 3001
let search = stream from "ws://localhost:9100"
let map = stream from "ws://localhost:9101"
view main =
row [
column [
text "🔍 Search"
text "Query: {search.query}"
text "Results: {search.filtered}"
]
column [
text "📍 Map"
text "{map.label}"
text "{map.lat}, {map.lng}"
]
]