@jsonjoy.com/util
Version:
Various helper utilities
19 lines (18 loc) • 413 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.invokeFirstOnly = void 0;
const invokeFirstOnly = () => {
let invoked = false;
return (fn) => {
if (invoked)
return;
invoked = true;
try {
return fn();
}
finally {
invoked = false;
}
};
};
exports.invokeFirstOnly = invokeFirstOnly;