I am developing a library (an SDK) and i use koin ...
# library-development
z
I am developing a library (an SDK) and i use koin internally, i want my SDK to have a
connect
and
disconnect
functions, which will internally call
startKoin
and
stopKoin
Will this mean that an app consuming my library and also uses koin be affected? how can i avoid this? The reason i want to call
stopKoin
is to clear all the singeltons my SDK creates as it initializes. What would be the best practice on using koin in a library project?
c
This seems to be a #koin question? It seems to be about the technical implementation of that particular library. I can't think of why you'd use a service locator inside a library.
Ah, I see you already posted this to #koin and #android (at least)… Avoid cross-posting, it spams everyone
z
Thank you i will.
By the way, i found an answer in the docs, there is a way to create an internal koin context for library developers. https://insert-koin.io/docs/reference/koin-core/context-isolation