sub

fun <T, I> RootStore<List<T>>.sub(element: T, id: IdProvider<T, I>): SubStore<List<T>, List<T>, T>

creates a SubStore using a RootStore as parent using a given IdProvider.

Parameters

element

current instance of the entity to focus on

id

to identify the same entity (i.e. when it's content changed)

fun <T> RootStore<List<T>>.sub(index: Int): SubStore<List<T>, List<T>, T>

creates a SubStore using a RootStore as parent using the index in the list (do not use this, if you want to manipulate the list itself (add or move elements, filter, etc.).

Parameters

index

position in the list to point to

fun <R, P, T, I> SubStore<R, P, List<T>>.sub(element: T, idProvider: IdProvider<T, I>): SubStore<R, List<T>, T>

creates a SubStore using another SubStore as parent using a given IdProvider.

Parameters

element

current instance of the entity to focus on

idProvider

to identify the same entity (i.e. when it's content changed)

fun <R, P, T> SubStore<R, P, List<T>>.sub(index: Int): SubStore<R, List<T>, T>

creates a SubStore using a SubStore as parent using the index in the list (do not use this, if you want to manipulate the list itself (add or move elements, filter, etc.).

Parameters

index

position in the list to point to