29 lines
812 B
Text
29 lines
812 B
Text
|
|
-- DreamStack Signal Composition Demo
|
||
|
|
-- Compose two independent widget streams into one dashboard.
|
||
|
|
--
|
||
|
|
-- Run with:
|
||
|
|
-- Tab 1: dreamstack stream examples/streaming-counter.ds
|
||
|
|
-- Tab 2: dreamstack stream examples/streaming-physics.ds --port 9101
|
||
|
|
-- Tab 3: dreamstack dev examples/compose-widgets.ds --port 3001
|
||
|
|
--
|
||
|
|
-- Open http://localhost:3001 to see both streams composed.
|
||
|
|
|
||
|
|
let counter = stream from "ws://localhost:9100"
|
||
|
|
let physics = stream from "ws://localhost:9101"
|
||
|
|
|
||
|
|
view main =
|
||
|
|
column [
|
||
|
|
text "📡 Composed Dashboard"
|
||
|
|
row [
|
||
|
|
column [
|
||
|
|
text "── Counter Widget ──"
|
||
|
|
text "Count: {counter.count}"
|
||
|
|
text "Doubled: {counter.doubled}"
|
||
|
|
]
|
||
|
|
column [
|
||
|
|
text "── Physics Widget ──"
|
||
|
|
text "Bodies: {physics.body_count}"
|
||
|
|
]
|
||
|
|
]
|
||
|
|
]
|