app / com.ocean.ishareeconomy_android.utils / ReusableRepositorySingleton / <init>

<init>

ReusableRepositorySingleton(creator: (A) -> T)

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