-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
02ded41
commit 81fcf57
Showing
7 changed files
with
49 additions
and
23 deletions.
There are no files selected for viewing
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: 10 additions & 0 deletions
10
core/interactor/src/main/kotlin/org/michaelbel/movies/interactor/SearchInteractor.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.michaelbel.movies.interactor | ||
|
||
import kotlinx.coroutines.flow.StateFlow | ||
|
||
interface SearchInteractor { | ||
|
||
val isSearchActive: StateFlow<Boolean> | ||
|
||
fun setSearchActive(value: Boolean) | ||
} |
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
21 changes: 21 additions & 0 deletions
21
.../interactor/src/main/kotlin/org/michaelbel/movies/interactor/impl/SearchInteractorImpl.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.michaelbel.movies.interactor.impl | ||
|
||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.StateFlow | ||
import kotlinx.coroutines.flow.asStateFlow | ||
import org.michaelbel.movies.interactor.SearchInteractor | ||
|
||
@Singleton | ||
internal class SearchInteractorImpl @Inject constructor(): SearchInteractor { | ||
|
||
private val isActiveMutableFlow: MutableStateFlow<Boolean> = MutableStateFlow(true) | ||
|
||
override val isSearchActive: StateFlow<Boolean> | ||
get() = isActiveMutableFlow.asStateFlow() | ||
|
||
override fun setSearchActive(value: Boolean) { | ||
isActiveMutableFlow.value = value | ||
} | ||
} |
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