import * as tsplus_module_1 from "@effect/core/io/Scope/operations/addFinalizerExit";
/**
 * Adds a finalizer to this scope. The finalizer is guaranteed to be run when
 * the scope is closed.
 *
 * @tsplus fluent ets/Scope addFinalizer
 * @tsplus fluent ets/Scope/Closeable addFinalizer
 */

export function addFinalizer_(self, finalizer) {
  return tsplus_module_1.addFinalizerExit_(self, () => finalizer());
}
/**
 * Adds a finalizer to this scope. The finalizer is guaranteed to be run when
 * the scope is closed.
 *
 * @tsplus static ets/Scope/Aspects addFinalizer
 */

export const addFinalizer = finalizer => self => addFinalizer_(self, finalizer);
//# sourceMappingURL=addFinalizer.mjs.map