From 7b002053e3a876d812d473b54e6a8654027eee50 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 15 Feb 2024 13:59:43 -0600 Subject: [PATCH] Update README.md Signed-off-by: Eric Schultz --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3912363..55ab682 100755 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ mounted() { } beforeDestroy() { - this.$socket.off('socket'); + this.$socket.$off('socket'); } ``` @@ -150,12 +150,12 @@ this.$socketManager.close(); ```js // Data received of the type string. // Emits an event by the name `message`. -this.$socket.on("message", () => {}); +this.$socket.$on("message", () => {}); // Data received as an object. // Emits an event based on the value for the 'event' key. // { event: "socket", data: "Hello world" } -this.$socket.on("socket", () => {}); +this.$socket.$on("socket", () => {}); ``` > 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).