-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e7a218
commit d8e161b
Showing
11 changed files
with
24 additions
and
103 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
app/src/main/java/com/mkchtv/cleantemplate/auth/AuthProtectedViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
package com.mkchtv.cleantemplate.auth | ||
|
||
import androidx.lifecycle.ViewModel | ||
import com.mkchtv.cleantemplate.domain.usecase.GetAuthStateFlowUseCase | ||
import com.mkchtv.cleantemplate.domain.usecase.GetAuthStateFlow | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class AuthProtectedViewModel @Inject constructor( | ||
getAuthStateFlow: GetAuthStateFlowUseCase, | ||
getAuthStateFlow: GetAuthStateFlow, | ||
) : ViewModel() { | ||
val authStateFlow = getAuthStateFlow() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
app/src/main/java/com/mkchtv/cleantemplate/di/UseCaseModule.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 2 additions & 8 deletions
10
domain/src/main/java/com/mkchtv/cleantemplate/domain/usecase/GetAllElements.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
package com.mkchtv.cleantemplate.domain.usecase | ||
|
||
import com.mkchtv.cleantemplate.domain.entity.Element | ||
import com.mkchtv.cleantemplate.domain.repository.ElementsRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
interface GetAllElementsUseCase { | ||
operator fun invoke(): Flow<List<Element>> | ||
} | ||
|
||
class GetAllElements @Inject constructor( | ||
private val repository: ElementsRepository | ||
) : GetAllElementsUseCase { | ||
override operator fun invoke() = repository.elementsFlow() | ||
) { | ||
operator fun invoke() = repository.elementsFlow() | ||
} |
10 changes: 2 additions & 8 deletions
10
domain/src/main/java/com/mkchtv/cleantemplate/domain/usecase/GetAuthStateFlow.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
package com.mkchtv.cleantemplate.domain.usecase | ||
|
||
import com.mkchtv.cleantemplate.domain.common.AuthState | ||
import com.mkchtv.cleantemplate.domain.repository.AuthRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
interface GetAuthStateFlowUseCase { | ||
operator fun invoke(): Flow<AuthState> | ||
} | ||
|
||
class GetAuthStateFlow @Inject constructor( | ||
private val repository: AuthRepository | ||
) : GetAuthStateFlowUseCase { | ||
override operator fun invoke() = repository.authStateFlow | ||
) { | ||
operator fun invoke() = repository.authStateFlow | ||
} |
10 changes: 2 additions & 8 deletions
10
domain/src/main/java/com/mkchtv/cleantemplate/domain/usecase/GetElement.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
package com.mkchtv.cleantemplate.domain.usecase | ||
|
||
import com.mkchtv.cleantemplate.domain.entity.Element | ||
import com.mkchtv.cleantemplate.domain.repository.ElementsRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
interface GetElementUseCase { | ||
operator fun invoke(elementId: Int): Flow<Element> | ||
} | ||
|
||
class GetElement @Inject constructor( | ||
private val repository: ElementsRepository | ||
) : GetElementUseCase { | ||
override operator fun invoke(elementId: Int) = repository.elementFlow(elementId) | ||
) { | ||
operator fun invoke(elementId: Int) = repository.elementFlow(elementId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters