RootInspector

class RootInspector<T>(data: T, id: String) : Inspector<T>

RootInspector is the starting point for getting your data and corresponding ids from your deep nested model structure. Get this by calling the factory method inspect.

Inspector is useful in validation process to know which html elements (when they are rendered with an store.id) are not valid.

Constructors

RootInspector
Link copied to clipboard
common
fun <T> RootInspector(data: T, id: String = "")

Functions

sub
Link copied to clipboard
common
open override fun <X> sub(lens: Lens<T, X>): SubInspector<T, T, X>
creates a new Inspector for a part of your underlying data-model

Properties

data
Link copied to clipboard
common
open override val data: T
T representation of stored data
id
Link copied to clipboard
common
open override val id: String
String representation of the corresponding id

Extensions

inspectEach
Link copied to clipboard
common
inline fun <T, I> RootInspector<List<T>>.inspectEach(noinline idProvider: IdProvider<T, I>, action: (SubInspector<List<T>, List<T>, T>) -> Unit)
Performs the given action on each SubInspector.
inline fun <X> RootInspector<List<X>>.inspectEach(action: (SubInspector<List<X>, List<X>, X>) -> Unit)
Performs the given action on each SubInspector.
sub
Link copied to clipboard
common
inline fun <T, I> RootInspector<List<T>>.sub(element: T, noinline idProvider: IdProvider<T, I>): SubInspector<List<T>, List<T>, T>
creates a Inspector for an element in your Inspector's list.
inline fun <X> RootInspector<List<X>>.sub(index: Int): SubInspector<List<X>, List<X>, X>
creates a Inspector for an element in your Inspector's list.