Input value.
A readonly val with value of inner val.
import { flatten, val } from "value-enhancer";
const inner$ = val(12);
const outer$ = val(inner$);
const flattened$ = flatten(outer$);
inner$.value === flattened$.value; // true
Flatten an inner val extracted from a source val to a val of the inner val value.
Input value.
Optional
get: ((value) => TValOrValue)extract inner val or value from source val.
Optional
config: ValConfig<UnwrapVal<TValOrValue>>A readonly val with value of inner val.
import { flatten, val } from "value-enhancer";
const inner$ = val(12);
const outer$ = val({ inner$ });
const flattened$ = flatten(outer$, ({ inner$ }) => inner$);
inner$.value === flattened$.value; // true
Flatten a val of val to a val of the inner val value.