"use strict"
Object.defineProperty(exports, "__esModule", { value: true })
exports.ensuringFirst_ = exports.ensuringFirst = void 0
const core_1 = require("../core")
/**
 * Ensures that `f` is executed when this `Managed` is finalized, before
 * the existing finalizer.
 *
 * For use cases that need access to the Managed's result, see `onExitFirst`.
 *
 * @dataFirst ensuringFirst_
 */
function ensuringFirst(f, __trace) {
  return (0, core_1.onExitFirst)(() => f, __trace)
}
exports.ensuringFirst = ensuringFirst
/**
 * Ensures that `f` is executed when this `Managed` is finalized, before
 * the existing finalizer.
 *
 * For use cases that need access to the Managed's result, see `onExitFirst_`.
 */
function ensuringFirst_(self, f, __trace) {
  return (0, core_1.onExitFirst_)(self, () => f, __trace)
}
exports.ensuringFirst_ = ensuringFirst_
//# sourceMappingURL=ensuringFirst.js.map
