UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

30 lines (29 loc) • 1.08 kB
import { r as createLazyPromiseLoader } from "./lazy-promise-DiCvjz9w.mjs"; //#region src/shared/lazy-runtime.ts function createLazyRuntimeSurface(e, t) { const n = createLazyPromiseLoader(() => e().then(t), { cacheRejections: true }); return Object.assign(n.load, { peek: n.peek, clear: n.clear }); } /** Cache the raw dynamically imported runtime module behind a stable loader. */ function createLazyRuntimeModule(e) { return createLazyRuntimeSurface(e, (e) => e); } /** Cache a single named runtime export without repeating a custom selector closure per caller. */ function createLazyRuntimeNamedExport(e, t) { return createLazyRuntimeSurface(e, (e) => e[t]); } function createLazyRuntimeMethod(e, t) { return async (...n) => { return await t(await e())(...n); }; } function createLazyRuntimeMethodBinder(e) { return function(t) { return createLazyRuntimeMethod(e, t); }; } //#endregion export { createLazyRuntimeSurface as a, createLazyRuntimeNamedExport as i, createLazyRuntimeMethodBinder as n, createLazyRuntimeModule as r, createLazyRuntimeMethod as t };