Open rostgoat opened 4 years ago
Rather having everything sit in main.ts, is there a way to export sockets into a class of it's own?
sockets
Having something like this can get rather cumbersome..
new Vue({ sockets: { connect() { this.$socket.client.emit("connected", { title: "cod" }); this.$socket.client.on("connected", (data: string) => console.log(data) ); } },
However when I try to use this.$socket in src/plugins/index.ts I get Property '$socket' does not exist on type 'NextClietPlugin'
this.$socket
src/plugins/index.ts
Property '$socket' does not exist on type 'NextClietPlugin'
Can you recommend anything @probil ?
Hey @rostgoat Could please provide me the class you've tried in src/plugins/index.ts? Without seeing usage it's hard to figure out the problem and why it didn't work
Rather having everything sit in main.ts, is there a way to export
sockets
into a class of it's own?Having something like this can get rather cumbersome..
However when I try to use
this.$socket
insrc/plugins/index.ts
I getProperty '$socket' does not exist on type 'NextClietPlugin'
Can you recommend anything @probil ?