This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: replace reaktive with pure coroutines
- Loading branch information
Showing
19 changed files
with
137 additions
and
120 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
object DefaultDispatchers : OpiaDispatchers { | ||
override val main: CoroutineDispatcher get() = Dispatchers.Main.immediate | ||
override val io: CoroutineDispatcher get() = Dispatchers.IO | ||
override val unconfined: CoroutineDispatcher get() = Dispatchers.Unconfined | ||
} |
This file was deleted.
Oops, something went wrong.
7 changes: 5 additions & 2 deletions
7
...n/src/commonMain/kotlin/MainDispatcher.kt → ...n/src/commonMain/kotlin/OpiaDispatcher.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,6 +1,9 @@ | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.Dispatchers | ||
|
||
// Desktop has no Main dispatcher, need Swing lib | ||
// Android doesn't allow dispatch (UI operation) from non-Main (not Default) | ||
expect fun mainDispatcher(): CoroutineDispatcher | ||
interface OpiaDispatchers { | ||
val main: CoroutineDispatcher | ||
val io: CoroutineDispatcher | ||
val unconfined: CoroutineDispatcher | ||
} |
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
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
48 changes: 0 additions & 48 deletions
48
common/src/commonMain/kotlin/app/opia/common/ui/auth/Auth.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
33 changes: 33 additions & 0 deletions
33
common/src/commonMain/kotlin/app/opia/common/ui/auth/AuthView.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,33 @@ | ||
package app.opia.common.ui.auth | ||
|
||
import app.opia.common.ui.auth.AuthView.Event | ||
import app.opia.common.ui.auth.AuthView.Model | ||
import app.opia.common.ui.auth.store.IdentityProvider | ||
import com.arkivanov.mvikotlin.core.view.MviView | ||
import java.util.* | ||
|
||
interface AuthView : MviView<Model, Event> { | ||
//val generalError: String?, | ||
data class Model( | ||
val isLoading: Boolean, | ||
val unique: String, | ||
val uniqueError: String?, | ||
val secret: String, | ||
val secretError: String? | ||
) | ||
|
||
// Intent / ViewEvent | ||
sealed class Event { | ||
data class UniqueChanged(val unique: String) : Event() | ||
data class SecretChanged(val secret: String) : Event() | ||
object LoginClicked : Event() | ||
object RegisterClicked : Event() | ||
data class ContinueWithProviderClicked(val provider: IdentityProvider) : Event() | ||
} | ||
|
||
sealed class Output { | ||
data class Authenticated(val selfId: UUID) : Output() | ||
data class ContinueWithProvider(val provider: IdentityProvider) : Output() | ||
object Register : Output() | ||
} | ||
} |
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
Oops, something went wrong.