"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAsyncProxy = void 0;
const createAsyncProxy = (asyncCallback) => {
    let promise = null;
    return async () => {
        if (promise) {
            return promise;
        }
        try {
            promise = asyncCallback();
            return await promise;
        }
        finally {
            promise = null;
        }
    };
};
exports.createAsyncProxy = createAsyncProxy;
