event-observer¶
event-observer is the base module. It owns the result model, status handling, and the reactive
wrappers that move DataResult<T> through Android and coroutine layers.
Install¶
What Lives Here¶
DataResult<T>DataResultStatusEventDataStatusResponseLiveDataMutableResponseLiveDataSwapResponseLiveDataResponseFlowResponseStateFlowResponseSharedFlow
Use It When¶
- you need the base observation model without Compose
- you want LiveData support in Android UI layers
- you want Flow-based state transport with the same result semantics
Example¶
val userState = responseLiveData<String> {
emitLoading()
emitData("Ready")
}
userState.observe(this) {
loading { println("loading") }
data { value -> println(value) }
error { throwable -> println(throwable.message) }
}