sk Skill · maxrave-dev
readonly-stateflow-cold-to-hot
Expose state through asStateFlow() rather than an upcast of the mutable holder, and turn a cold source flow hot with stateIn(scope, WhileSubscribed(timeout), initial) so it survives collector churn without running forever. Use when a screen re-queries its source on every rotation or navigation, when work continues after the last collector leaves, or when something outside the owner is writing state it should only be…
Open on skills.sh ↗read 2026-09-19
- installs 8w
- 0
- 30-day movement
- starts with the next reading
- Related entries
- 1
- Connections
- 0
kotlin
- Host repository
- maxrave-dev/kotlin-footguns
- Host stars
- 541