DataLoader

class DataLoader<T>(component: Component<*>, val options: DataLoader.Options<T>)

Constructors

Link copied to clipboard
constructor(component: Component<*>, options: DataLoader.Options<T>)

Types

Link copied to clipboard
data class Options<T>(val load: suspend () -> Flow<T>)
Link copied to clipboard
class Render<T>
Link copied to clipboard
sealed class State<T>

Properties

Link copied to clipboard
Link copied to clipboard

The current state of the loader

Link copied to clipboard
val value: Stream<T?>

The current value of the loader

Functions

Link copied to clipboard
operator fun invoke(flow: FlowContent, block: DataLoader.Render<T>.() -> Unit)
Link copied to clipboard

Returns true when the loader is in the State.Error

Link copied to clipboard

Returns true when the loader is in the State.Loaded

Link copied to clipboard

Returns true when the loader is in the State.Loading

Link copied to clipboard

Returns true when the loader is NOT in the State.Error

Link copied to clipboard

Returns true when the loader is NOT in the State.Loaded

Link copied to clipboard

Returns true when the loader is NOT in the State.Loading

Link copied to clipboard
fun modifyValue(block: (T) -> T)
Link copied to clipboard
fun reload(debounceMs: Long = 200)
Link copied to clipboard
fun reloadSilently(debounceMs: Long = 200)
Link copied to clipboard
fun setLoaded(data: T)
Link copied to clipboard