Return type of the toGetter function.
Like OptionalLens, a Getter<T> can be used for optional chaining on arbitrary union types.
In contrast to OptionalLens, the initial Getter<T> must be obtained from a value of type T.
You can thus use it as kind of ad-hoc lens for a one-time access. In most cases however,
using an OptionalLens is the better choice.
Return type of the toGetter function. Like OptionalLens, a
Getter<T>
can be used for optional chaining on arbitrary union types. In contrast to OptionalLens, the initialGetter<T>
must be obtained from a value of typeT
. You can thus use it as kind of ad-hoc lens for a one-time access. In most cases however, using an OptionalLens is the better choice.See
toGetter
documentation for example usage.