UNPKG

@jsonjoy.com/util

Version:
19 lines (18 loc) 413 B
"use strict"; 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;