full reborn
This commit is contained in:
@@ -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)
|
@@ -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()
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
package dev.inmo.postssystem.features.common.common
|
||||
|
||||
interface UIView {
|
||||
}
|
@@ -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
|
||||
}
|
1
features/common/client/src/main/AndroidManifest.xml
Normal file
1
features/common/client/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1 @@
|
||||
<manifest package="dev.inmo.postssystem.features.common.client"/>
|
Reference in New Issue
Block a user