Use @Singleton where possible

This commit is contained in:
Kirill Kamakin
2022-04-03 02:18:12 +05:00
parent 8fee0c3a3d
commit ec5d05c819
12 changed files with 24 additions and 0 deletions

View File

@@ -12,7 +12,9 @@ import retrofit2.HttpException
import retrofit2.Response
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class AuthDataSourceImpl @Inject constructor(
private val authServiceFactory: ServiceFactory<AuthService>,
private val json: Json,

View File

@@ -11,7 +11,9 @@ import kotlinx.coroutines.flow.map
import okhttp3.HttpUrl.Companion.toHttpUrl
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class AuthRepoImpl @Inject constructor(
private val dataSource: AuthDataSource,
private val storage: AuthStorage,

View File

@@ -9,10 +9,12 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Singleton
private const val AUTH_HEADER_KEY = "AUTH_TOKEN"
private const val BASE_URL_KEY = "BASE_URL"
@Singleton
class AuthStorageImpl @Inject constructor(
private val sharedPreferences: SharedPreferences
) : AuthStorage {