Koin Viewmodel Scoping Traps

Wiring view models through a runtime dependency-injection container without losing track of their lifetime — the service-locator base class and what it costs, annotation-based definitions that compile but register nothing, which store owner each accessor addresses and why that (not the accessor's spelling) decides whether two screens share an instance, and what registering a view model as a process-wide singleton makes you responsible for. Use when a view model resolves to a fresh instance that should have been shared, when a lookup fails at runtime for a class that is clearly annotated, or when state vanishes between screens.

maxrave-dev Updated 2.3k repo stars
The SimpMusic repository on GitHub

File contents

maxrave-dev/kotlin-footguns commit a01dadcfaa

Frequently asked questions

npx get-skill add maxrave-dev/koin-viewmodel-scoping-traps