mapNull

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

on a Store of nullable data this creates a Store with a nullable parent and non-nullable value. It can be called using a Lens on a non-nullable parent (that can be created by using the @Lenses-annotation), but you have to provide a default value. 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 translate null to and from