📄️ Built-in Scopes
Anchor DI provides three built-in scopes: SingletonComponent, ViewModelComponent, and NavigationComponent. This page explains when to use each one, how they differ, and how to use them in practice. Understanding scopes is key to designing a clean and memory-efficient dependency graph.
📄️ Creating Custom Scopes
The built-in scopes (Singleton, ViewModel, Navigation) cover most cases. But sometimes you need a scope that matches your lifecycle — for example, one instance per Activity, per user session, or per flow. Anchor DI lets you define custom scopes and control when they start and end. This page explains how.