HomeObjectsFlow

class HomeObjectsFlowHasId> : Flow

A Flow of a Set of home objects. A new value is emitted on the flow whenever any object in the set changes.

list, itemFlow, and get are provided as convenience methods for common operations.

Summary

Public functions

suspend T?
get(id: Id)

Gets the latest value of the home object with the corresponding Id and terminates the subscription.

Flow
itemFlow(id: Id)

Creates a filtered flow of distinct items given an Id.

Flow
itemFlow(item: T)

Creates a filtered flow of items that match the item type.

suspend Set

Gets the latest value of the home objects and terminates the subscription.

Flow<HomeObjectChangeEvent>

Converts the current flow into a streaming event flow for objects added, modified, deleted or initialized.

Public properties

Flow<Set>

the Set of home objects used by the Flow.

Inherited functions

From kotlinx.coroutines.flow.Flow
open suspend Unit
collect(collector: FlowCollector<Set>)

Public functions

get

suspend fun get(id: Id): T?

Gets the latest value of the home object with the corresponding Id and terminates the subscription.

Parameters
id: Id

the ID of the item to get.

Returns
T?

the latest value of the item.

itemFlow

fun itemFlow(id: Id): Flow

Creates a filtered flow of distinct items given an Id.

Parameters
id: Id

the ID of the item to create a flow for.

Returns
Flow

the filtered flow.

itemFlow

fun itemFlow(item: T): Flow

Creates a filtered flow of items that match the item type.

Parameters
item: T

the item type to create a flow for.

Returns
Flow

the filtered flow.

list

suspend fun list(): Set

Gets the latest value of the home objects and terminates the subscription.

Returns
Set

the latest value of the item.

stream

@HomeExperimentalApi
fun stream(): Flow<HomeObjectChangeEvent>

Converts the current flow into a streaming event flow for objects added, modified, deleted or initialized.

Public properties

flow

val flowFlow<Set>

the Set of home objects used by the Flow.