toPartial(): PartialLens
ts
toPartial: <A>() => PartialLens<NonNullable<A>, A>;
ts
toPartial: <A>() => PartialLens<NonNullable<A>, A>;
This combinator, when passed to composed with an optic focused on a nullable type, returns a new partial optic focused on the non-nullable type.
ts
import {toPartial } from "@optics/react/combinators";constnumberOptic =createState <number | null>(42);constpartialNumberOptic =numberOptic .derive (toPartial ());
ts
import {toPartial } from "@optics/react/combinators";constnumberOptic =createState <number | null>(42);constpartialNumberOptic =numberOptic .derive (toPartial ());