Rocky_Mountain_Vending/.pnpm-store/v10/files/76/68251765cef09c6c39342eb530374c14ac24430b29231ab9a162e493a1a5fa9fe5def097ecbe575ab95ff0bc255d367232e3231a426ae911d566f05c9a3027
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

27 lines
No EOL
699 B
Text

const isPromiseLike = (value) => typeof value === 'object' && !!value && 'then' in value;
/**
* A helper function that calls `.dispose()` on the {@link IDisposable} when
* the given function (or promise returned by the function) returns.
*/
export const using = (disposable, fn) => {
let ret;
try {
ret = fn(disposable);
}
catch (e) {
disposable.dispose();
throw e;
}
if (!isPromiseLike(ret)) {
disposable.dispose();
return ret;
}
return ret.then(value => {
disposable.dispose();
return value;
}, err => {
disposable.dispose();
throw err;
});
};
//# sourceMappingURL=disposable.js.map