// ets_tracing: off import type { Effect } from "../Effect/effect.js" import type { XFiberRef } from "./fiberRef.js" /** * Returns an `Effect` that runs with `value` bound to the current fiber. * * Guarantees that fiber data is properly restored via `bracket`. * * @ets_data_first locally_ */ export function locally(value: A) { return ( fiberRef: XFiberRef ): ((effect: Effect) => Effect) => locally_(fiberRef, value) } /** * Returns an `Effect` that runs with `value` bound to the current fiber. * * Guarantees that fiber data is properly restored via `bracket`. */ export function locally_(fiberRef: XFiberRef, value: A) { return (effect: Effect) => fiberRef.locally(value, effect) }