Rocky_Mountain_Vending/.pnpm-store/v10/files/ac/c8f05f60103f65207dc35bf99430d7e1c62a58cd21c1dbb5ba3d8aecf7e489e4c1c2dd433e6db8f830a36326723442e617307722d586e8b5384f45077046a7
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

28 lines
No EOL
939 B
Text

/**
* Calls the given async function only when the returned promise-like object is
* awaited. Afterwards, it provides the resolved value synchronously as `value`
* property.
*/ export function createLazyResult(fn) {
let pendingResult;
const result = {
then (onfulfilled, onrejected) {
if (!pendingResult) {
pendingResult = fn();
}
pendingResult.then((value)=>{
result.value = value;
}).catch(()=>{
// The externally awaited result will be rejected via `onrejected`. We
// don't need to handle it here. But we do want to avoid an unhandled
// rejection.
});
return pendingResult.then(onfulfilled, onrejected);
}
};
return result;
}
export function isResolvedLazyResult(result) {
return result.hasOwnProperty('value');
}
//# sourceMappingURL=lazy-result.js.map