full reborn

This commit is contained in:
2021-11-24 13:52:27 +06:00
parent 0ac6b0a4df
commit 6a6a197041
246 changed files with 4327 additions and 6952 deletions

View File

@@ -0,0 +1,7 @@
package dev.inmo.postssystem.features.common.common
import kotlinx.coroutines.flow.MutableStateFlow
inline fun <T> DefaultMVVMStateFlow(
state: T
) = MutableStateFlow<T>(state)

View File

@@ -0,0 +1,15 @@
package dev.inmo.postssystem.features.common.common
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
interface UIModel<StateType> {
val currentState: StateFlow<StateType>
}
abstract class AbstractUIModel<StateType>(
initState: StateType
) : UIModel<StateType> {
protected val _currentState = DefaultMVVMStateFlow(initState)
override val currentState: StateFlow<StateType> = _currentState.asStateFlow()
}

View File

@@ -0,0 +1,4 @@
package dev.inmo.postssystem.features.common.common
interface UIView {
}

View File

@@ -0,0 +1,15 @@
package dev.inmo.postssystem.features.common.common
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
interface UIViewModel<StateType> {
val currentState: StateFlow<StateType>
}
abstract class AbstractUIViewModel<StateType> : UIViewModel<StateType> {
protected val _currentState = DefaultMVVMStateFlow(initState())
override val currentState: StateFlow<StateType> = _currentState.asStateFlow()
abstract fun initState(): StateType
}

View File

@@ -0,0 +1 @@
<manifest package="dev.inmo.postssystem.features.common.client"/>