Skip to content

Commit 187c8c5

Browse files
authored
fix: usage docs in README
Signed-off-by: Eric Schultz <eric@startuperic.com>
1 parent 5b6ec44 commit 187c8c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ mounted() {
9999
}
100100

101101
beforeDestroy() {
102-
this.$socket.off('socket');
102+
this.$socket.$off('socket');
103103
}
104104
```
105105

@@ -150,12 +150,12 @@ this.$socketManager.close();
150150
```js
151151
// Data received of the type string.
152152
// Emits an event by the name `message`.
153-
this.$socket.on("message", () => {});
153+
this.$socket.$on("message", () => {});
154154

155155
// Data received as an object.
156156
// Emits an event based on the value for the 'event' key.
157157
// { event: "socket", data: "Hello world" }
158-
this.$socket.on("socket", () => {});
158+
this.$socket.$on("socket", () => {});
159159
```
160160

161161
> The [close event handler](https://github.com/deepsourcelabs/nuxt-websocket/blob/main/src/templates/WebSocketManager.ts#L48-L64) attempts reconnection for a close event that is not normal ([connection close code](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code) other than 1000).

0 commit comments

Comments
 (0)