0Pricing
Kotlin Multiplatform Academy · Lesson

single vs factory Scopes

Choose singletons versus fresh instances.

Two Ways to Build

Koin gives you two main definition keywords: single and factory. They differ in one thing, how often Koin builds the object.

single Means One Instance

A single is created once and shared everywhere. Every part of your app that asks for it receives the very same object. 🔁

single { UserRepository(get()) }

All lessons in this course

  1. Declare a Shared Koin Module
  2. single vs factory Scopes
  3. Start Koin on Android & iOS
  4. Inject into ViewModels & Repos
← Back to Kotlin Multiplatform Academy