// ets_tracing: off import * as Tp from "../Collections/Immutable/Tuple/index.js" import type { XFiberRef } from "./fiberRef.js" import { modify_ } from "./modify.js" /** * Atomically modifies the `FiberRef` with the specified function. * * @ets_data_first update_ */ export function update(f: (a: A) => A) { return (self: XFiberRef) => update_(self, f) } /** * Atomically modifies the `FiberRef` with the specified function. */ export function update_(self: XFiberRef, f: (a: A) => A) { return modify_(self, (v) => Tp.tuple<[void, A]>(undefined, f(v))) }