mapNull

fun <D> Inspector<D?>.mapNull(default: D): Inspector<D>

Creates a new Inspector from a nullable parent inspector that either contains the original value or a given default value if the original value was null.

When updating the value of the resulting Inspector to this default value, null is used instead updating the parent. When this Inspector's value would be null according to it's parent's value, the default value will be used instead.

Parameters

default

value to be used instead of null

fun <T> Store<T?>.mapNull(default: T): Store<T>

Creates a new Store from a nullable parent store that either contains the original value or a given default value if the original value was null.

When updating the value of the resulting Store to this default value, null is used instead updating the parent. When this Store's value would be null according to it's parent's value, the default value will be used instead.

Parameters

default

value to be used instead of null