UiStates

inline fun <T> DataState<T>.UiStates(loading: @Composable () -> Unit, failure: @Composable (error: Throwable?) -> Unit, content: @Composable (content: T, loading: Boolean, error: Throwable?) -> Unit)

Composable function to render the different states of a DataState object.

Parameters

T

The type of the content.

loading

Composable to render when the data is loading.

failure

Composable to render when there is an error.

content

Composable to render the content. If loading is true and error is not null, it indicates that the content comes from the cache.