export function memoizeAsync(fn) {
    let cached;
    const wrapper = async () => {
        if (cached)
            return cached.value;
        const value = await fn();
        cached = { value };
        return value;
    };
    wrapper.invalidate = () => {
        cached = undefined;
    };
    return wrapper;
}
//# sourceMappingURL=memoize.js.map