Skip to content

Instantly share code, notes, and snippets.

@danopia
Last active September 4, 2020 21:57
Show Gist options
  • Save danopia/4f13b5c9cd2b9e88ff431c31755e43b5 to your computer and use it in GitHub Desktop.
Save danopia/4f13b5c9cd2b9e88ff431c31755e43b5 to your computer and use it in GitHub Desktop.
export default fetch
export default 'TODO'
import {WebSocket} from 'https://deno.land/x/[email protected]/mod.ts'
export default class BrowserWebSocket extends WebSocket {
constructor(url) {
super(url);
this.on('close', (...args) => this.onclose(...args));
this.on('error', (...args) => this.onerror(...args));
this.on('message', (data) => this.onmessage({ data }));
this.on('open', (...args) => this.onopen(...args));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment