Rocky_Mountain_Vending/.pnpm-store/v10/files/cd/2a379f7f67c99ddd9681ef084ce70442a9db69e7f8a06d7f3d7d348b3a19092c7f8b037eca1db1677f6a0df710690dff17efa6f483ef952f57ca83c5208c18
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

39 lines
No EOL
1.1 KiB
Text

/**
* @internal
*/
export class BrowserWebSocketTransport {
static create(url) {
return new Promise((resolve, reject) => {
const ws = new WebSocket(url);
ws.addEventListener('open', () => {
return resolve(new BrowserWebSocketTransport(ws));
});
ws.addEventListener('error', reject);
});
}
#ws;
onmessage;
onclose;
constructor(ws) {
this.#ws = ws;
this.#ws.addEventListener('message', event => {
if (this.onmessage) {
this.onmessage.call(null, event.data);
}
});
this.#ws.addEventListener('close', () => {
if (this.onclose) {
this.onclose.call(null);
}
});
// Silently ignore all errors - we don't know what to do with them.
this.#ws.addEventListener('error', () => { });
}
send(message) {
this.#ws.send(message);
}
close() {
this.#ws.close();
}
}
//# sourceMappingURL=BrowserWebSocketTransport.js.map