feat: 4-app signal composition demo with explicit outputs
Add 3 new streaming apps with explicit output declarations:
- streaming-clock.ds: output hours, minutes, seconds (tick private)
- streaming-stats.ds: output total, average, max (sum private)
- streaming-mood.ds: output mood, energy, color (clicks private)
Add compose-dashboard.ds that receives all 4 streams via unique
relay channels (/stream/default, /stream/clock, /stream/stats,
/stream/mood) into a single dashboard view.
Each app demonstrates selective signal registration — only declared
outputs are streamed, internal state remains private.
2026-02-26 09:04:22 -08:00
|
|
|
-- DreamStack Streaming Mood
|
|
|
|
|
-- Interactive mood and energy tracker.
|
|
|
|
|
-- Only mood, energy, color are exposed (clicks is internal).
|
|
|
|
|
--
|
|
|
|
|
-- Run with:
|
2026-02-26 17:44:21 -08:00
|
|
|
-- dreamstack stream examples/streaming-mood.ds --port 3004
|
feat: 4-app signal composition demo with explicit outputs
Add 3 new streaming apps with explicit output declarations:
- streaming-clock.ds: output hours, minutes, seconds (tick private)
- streaming-stats.ds: output total, average, max (sum private)
- streaming-mood.ds: output mood, energy, color (clicks private)
Add compose-dashboard.ds that receives all 4 streams via unique
relay channels (/stream/default, /stream/clock, /stream/stats,
/stream/mood) into a single dashboard view.
Each app demonstrates selective signal registration — only declared
outputs are streamed, internal state remains private.
2026-02-26 09:04:22 -08:00
|
|
|
|
|
|
|
|
let mood = "neutral"
|
|
|
|
|
let energy = 50
|
|
|
|
|
let color = "gray"
|
|
|
|
|
let clicks = 0
|
|
|
|
|
|
|
|
|
|
stream mood_tracker on "ws://localhost:9100/peer/mood" {
|
|
|
|
|
mode: signal,
|
|
|
|
|
output: mood, energy, color
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
view mood_tracker =
|
|
|
|
|
column [
|
|
|
|
|
text "😊 Mood Tracker"
|
|
|
|
|
text "Mood: {mood}"
|
|
|
|
|
text "Energy: {energy}%"
|
|
|
|
|
text "Color: {color}"
|
|
|
|
|
row [
|
2026-02-26 17:44:21 -08:00
|
|
|
button "😄 Happy" { click: mood = "happy"; color = "green"; energy += 10 }
|
|
|
|
|
button "😐 Neutral" { click: mood = "neutral"; color = "gray" }
|
|
|
|
|
button "😤 Angry" { click: mood = "angry"; color = "red"; energy -= 10 }
|
feat: 4-app signal composition demo with explicit outputs
Add 3 new streaming apps with explicit output declarations:
- streaming-clock.ds: output hours, minutes, seconds (tick private)
- streaming-stats.ds: output total, average, max (sum private)
- streaming-mood.ds: output mood, energy, color (clicks private)
Add compose-dashboard.ds that receives all 4 streams via unique
relay channels (/stream/default, /stream/clock, /stream/stats,
/stream/mood) into a single dashboard view.
Each app demonstrates selective signal registration — only declared
outputs are streamed, internal state remains private.
2026-02-26 09:04:22 -08:00
|
|
|
]
|
|
|
|
|
row [
|
2026-02-26 17:44:21 -08:00
|
|
|
button "☕ Caffeine" { click: energy += 25; clicks += 1 }
|
|
|
|
|
button "😴 Rest" { click: energy -= 15; clicks += 1 }
|
feat: 4-app signal composition demo with explicit outputs
Add 3 new streaming apps with explicit output declarations:
- streaming-clock.ds: output hours, minutes, seconds (tick private)
- streaming-stats.ds: output total, average, max (sum private)
- streaming-mood.ds: output mood, energy, color (clicks private)
Add compose-dashboard.ds that receives all 4 streams via unique
relay channels (/stream/default, /stream/clock, /stream/stats,
/stream/mood) into a single dashboard view.
Each app demonstrates selective signal registration — only declared
outputs are streamed, internal state remains private.
2026-02-26 09:04:22 -08:00
|
|
|
]
|
|
|
|
|
]
|