Package app.futured.arkitekt.core.livedata

Types

Link copied to clipboard
class DefaultValueLiveData<T : Any>(defaultValue: T) : MutableLiveData<T>

Extended LiveData class with default value. Default value can't be null.

Link copied to clipboard
class DefaultValueMediatorLiveData<T : Any>(defaultValue: T) : MediatorLiveData<T>

Extended MediatorLiveData class with default value. Default value can't be null.

Link copied to clipboard
class NonNullLiveData<T : Any>(initValue: T) : LiveData<T>

Immutable live data abstraction capable of mapping and preserving the non null value

Link copied to clipboard
class UiData<T : Any>(initValue: T) : MutableLiveData<T>

Mutable live data abstraction with non nullable value type. You need to initialize it with non null value. You can use one of the init functions or extension function

Link copied to clipboard
class UiDataMediator<T : Any>(initValue: T) : MediatorLiveData<T>

Functions

Link copied to clipboard
fun <T1, T2, RESULT> combineLiveData(t1: LiveData<T1>, t2: LiveData<T2>, callback: (T1, T2) -> RESULT): LiveData<RESULT>
fun <T1, T2, T3, RESULT> combineLiveData(t1: LiveData<T1>, t2: LiveData<T2>, t3: LiveData<T3>, callback: (T1, T2, T3) -> RESULT): LiveData<RESULT>
fun <T1, T2, T3, T4, RESULT> combineLiveData(t1: LiveData<T1>, t2: LiveData<T2>, t3: LiveData<T3>, t4: LiveData<T4>, callback: (T1, T2, T3, T4) -> RESULT): LiveData<RESULT>
fun <T1, T2, T3, T4, T5, RESULT> combineLiveData(t1: LiveData<T1>, t2: LiveData<T2>, t3: LiveData<T3>, t4: LiveData<T4>, t5: LiveData<T5>, callback: (T1, T2, T3, T4, T5) -> RESULT): LiveData<RESULT>
fun <T1, T2, T3, T4, T5, T6, RESULT> combineLiveData(t1: LiveData<T1>, t2: LiveData<T2>, t3: LiveData<T3>, t4: LiveData<T4>, t5: LiveData<T5>, t6: LiveData<T6>, callback: (T1, T2, T3, T4, T5, T6) -> RESULT): LiveData<RESULT>
fun <T1, T2, T3, T4, T5, T6, T7, RESULT> combineLiveData(t1: LiveData<T1>, t2: LiveData<T2>, t3: LiveData<T3>, t4: LiveData<T4>, t5: LiveData<T5>, t6: LiveData<T6>, t7: LiveData<T7>, callback: (T1, T2, T3, T4, T5, T6, T7) -> RESULT): LiveData<RESULT>
Link copied to clipboard
fun <T : Any> LiveData<T>.nonNull(defaultValue: T): DefaultValueMediatorLiveData<T>
Link copied to clipboard
fun <T> LiveData<T>.observe(lifecycleOwner: LifecycleOwner, callback: (T?) -> Unit)
Link copied to clipboard
fun <T> LiveData<T>.observeNonNull(lifecycleOwner: LifecycleOwner, callback: (T) -> Unit)
Link copied to clipboard
inline fun <T : Any> T.toUiData(): UiData<T>

Initialization extension function for UiData Usage: val myData: UiData = 1.toUiData()

Link copied to clipboard
inline fun <T : Any> uiData(initValue: T): UiData<T>

Initialization function for UiData Usage: val myData: UiData = uiData(1)

inline fun <T : Any> uiData(initBlock: () -> T): UiData<T>

Initialization function for UiData Usage: val myData: UiData = uiData { 1 }