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 a01dadc 8.9 KB Updated

File contents

maxrave-dev/kotlin-footguns/tree/main/skills/koin-viewmodel-scoping-traps commit a01dadcfaa

Frequently asked questions

npx skillmds@latest add maxrave-dev/koin-viewmodel-scoping-traps