Koin: How to handle scope?

sree kumar
Nov 4 · 2 min read

Most of the time we end up in a place where you need a dependency only for a specific duration of time.

By default in Koin, we have 3 kinds of scopes:

  • single definition, create an object that persistent with the entire container lifetime (Similar to Singleton).
  • factory definition, create a new object each time. No persistence in the container (can’t be shared).
  • scoped definition, create an object that persistent tied to the associated scope lifetime.

Keep the story going. Sign up for an extra free read.

You've completed your member preview for this month, but when you sign up for a free Medium account, you get one more story.
Already have an account? Sign in

sree kumar

Written by

Android Software Engineer @ YmediaLabs https://www.linkedin.com/in/sreevijayanak/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade