generated from y9vad9/kotlin-project-template
-
-
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.
refactor: from MVI with ViewModels to MVI with the Decompose
- Loading branch information
Showing
99 changed files
with
914 additions
and
928 deletions.
There are no files selected for viewing
15 changes: 9 additions & 6 deletions
15
...ommonMain/kotlin/org/timemates/app/authorization/dependencies/screens/AfterStartModule.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
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
11 changes: 6 additions & 5 deletions
11
...kotlin/org/timemates/app/authorization/dependencies/screens/InitialAuthorizationModule.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,17 @@ | ||
package org.timemates.app.authorization.dependencies.screens | ||
|
||
import org.timemates.app.authorization.ui.initial_authorization.mvi.InitialAuthorizationReducer | ||
import org.timemates.app.authorization.ui.initial_authorization.mvi.InitialAuthorizationStateMachine | ||
import org.koin.core.annotation.Factory | ||
import org.koin.core.annotation.Module | ||
import org.timemates.app.authorization.ui.initial_authorization.mvi.InitialAuthorizationReducer | ||
import org.timemates.app.authorization.ui.initial_authorization.mvi.InitialAuthorizationScreenComponent | ||
|
||
@Module | ||
class InitialAuthorizationModule { | ||
@Factory | ||
fun stateMachine(): InitialAuthorizationStateMachine { | ||
return InitialAuthorizationStateMachine( | ||
reducer = InitialAuthorizationReducer() | ||
fun mviComponent(componentComponent: InitialAuthorizationScreenComponent): InitialAuthorizationScreenComponent { | ||
return InitialAuthorizationScreenComponent( | ||
componentContext = componentComponent, | ||
reducer = InitialAuthorizationReducer(), | ||
) | ||
} | ||
} |
15 changes: 9 additions & 6 deletions
15
...nMain/kotlin/org/timemates/app/authorization/dependencies/screens/NewAccountInfoModule.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
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
12 changes: 6 additions & 6 deletions
12
.../commonMain/kotlin/org/timemates/app/authorization/ui/afterstart/mvi/AfterStartReducer.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
42 changes: 42 additions & 0 deletions
42
...ain/kotlin/org/timemates/app/authorization/ui/afterstart/mvi/AfterStartScreenComponent.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,42 @@ | ||
package org.timemates.app.authorization.ui.afterstart.mvi | ||
|
||
import com.arkivanov.decompose.ComponentContext | ||
import io.timemates.sdk.authorization.email.types.value.VerificationHash | ||
import kotlinx.serialization.Serializable | ||
import org.timemates.app.authorization.ui.afterstart.mvi.AfterStartScreenComponent.Effect | ||
import org.timemates.app.authorization.ui.afterstart.mvi.AfterStartScreenComponent.Event | ||
import org.timemates.app.authorization.ui.afterstart.mvi.AfterStartScreenComponent.State | ||
import org.timemates.app.foundation.mvi.MVIComponent | ||
import org.timemates.app.foundation.mvi.UiEffect | ||
import org.timemates.app.foundation.mvi.UiEvent | ||
import org.timemates.app.foundation.mvi.UiState | ||
import org.timemates.app.foundation.mvi.mviComponent | ||
|
||
class AfterStartScreenComponent( | ||
componentContext: ComponentContext, | ||
reducer: AfterStartReducer, | ||
) : MVIComponent<State, Event, Effect> by mviComponent( | ||
componentName = "AfterStartComponent", | ||
componentContext = componentContext, | ||
initState = State, | ||
reducer = reducer, | ||
middlewares = emptyList(), | ||
) { | ||
@Serializable | ||
data object State : UiState { | ||
private fun readResolve(): Any = State | ||
|
||
} | ||
|
||
sealed class Effect : UiEffect { | ||
data class NavigateToConfirmation(val verificationHash: VerificationHash) : Effect() | ||
|
||
data object OnChangeEmailClicked : Effect() | ||
} | ||
|
||
sealed class Event : UiEvent { | ||
data object NextClicked : Event() | ||
|
||
data object OnChangeEmailClicked : Event() | ||
} | ||
} |
Oops, something went wrong.