Data Source Builder
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
A flow of updated item names. Updates are propagated in a form of Flow of names of updated nodes. Those can include new data items and replacement of existing ones. The replaced items could update existing data content and replace it completely, so they should be pulled again.
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Stop generating updates from this DataSource
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> DataSourceBuilder<T>.emit(name: String, parent: CoroutineScope, noinline block: DataSourceBuilder<T>.() -> Unit)
inline fun <T : Any> DataSourceBuilder<T>.emit(name: Name, parent: CoroutineScope, noinline block: DataSourceBuilder<T>.() -> Unit)
Link copied to clipboard
inline fun <R : Any> DataSet<*>.filterByType(noinline predicate: (name: Name, meta: Meta) -> Boolean = { _, _ -> true }): DataSet<R>
Select a single datum of the appropriate type
fun <R : Any> DataSet<*>.filterByType(type: KType, predicate: (name: Name, meta: Meta) -> Boolean = { _, _ -> true }): DataSource<R>
Select all data matching given type and filters. Does not modify paths
Link copied to clipboard
inline fun <T : Any, R : Any> DataSet<T>.foldToData(initial: R, coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline block: suspend (result: R, data: NamedValueWithMeta<T>) -> R): Data<R>
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> DataSetBuilder<T>.node(name: String, crossinline block: DataSetBuilder<T>.() -> Unit)
inline fun <T : Any> DataSetBuilder<T>.node(name: Name, crossinline block: DataSetBuilder<T>.() -> Unit)
Link copied to clipboard
Update data with given node data and meta with node meta.
Link copied to clipboard
inline fun <T : Any> DataSetBuilder<T>.produce(name: String, meta: Meta = Meta.EMPTY, noinline producer: suspend () -> T)
Produce lazy Data and emit it into the DataSetBuilder
Link copied to clipboard
inline fun <T : Any, R : Any> DataSet<T>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, crossinline transformation: suspend (Iterable<NamedValueWithMeta<T>>) -> R): Data<R>
Link copied to clipboard
Copy given data set and mirror its changes to this DataTreeBuilder in this@setAndObserve. Returns an update Job
Link copied to clipboard