open class ReusableRepositorySingleton<out T : Any, in A>
Part of utils.
Enables the safe creation of repositories that take arguments in their constructors;
Usage: set the repo's constructor to private and make companion object of ReusableRepositorySingleton to get the singleton instance
Implementation from: https://medium.com/@BladeCoder/kotlin-singletons-with-argument-194ef06edd9e
Author
Christophe Beyls
<init> |
Part of utils. ReusableRepositorySingleton(: (A) -> T) |
getInstance |
Provides the safe singleton instance. fun getInstance(: A): T |