class UserPreferencesRepository private constructor(context: Context) {
companion object {
@Volatile
private var INSTANCE: UserPreferencesRepository? = null
fun getInstance(context: Context): UserPreferencesRepository {
return INSTANCE ?: synchronized(this) {
INSTANCE?.let {
return it
}
val instance = UserPreferencesRepository(context)
INSTANCE = instance
instance
}
}
}
}