From f0abaafe966ae4ac8e6d7416c37cf3f6fd3615c2 Mon Sep 17 00:00:00 2001 From: angrycandy Date: Thu, 21 Oct 2021 11:13:46 -0400 Subject: [PATCH 1/2] Update channels.md Correct instruction to match v1.6.2 `assets/js/app.js`: ```javascript // If you want to use Phoenix channels, run `mix help phx.gen.channel` // to get started and then uncomment the line below. // import "./user_socket.js" // You can include dependencies in two ways. ``` --- guides/real_time/channels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/real_time/channels.md b/guides/real_time/channels.md index 72b892f26d..8abbcfed63 100644 --- a/guides/real_time/channels.md +++ b/guides/real_time/channels.md @@ -267,11 +267,11 @@ channel.join() export default socket ``` -After that, we need to make sure `assets/js/user_socket.js` gets imported into our application JavaScript file. To do that, uncomment the last line in `assets/js/app.js`. +After that, we need to make sure `assets/js/user_socket.js` gets imported into our application JavaScript file. To do that, uncomment the line in `assets/js/app.js`. ```javascript // ... -import socket from "./user_socket" +import "./user_socket.js" ``` Save the file and your browser should auto refresh, thanks to the Phoenix live reloader. If everything worked, we should see "Joined successfully" in the browser's JavaScript console. Our client and server are now talking over a persistent connection. Now let's make it useful by enabling chat. From 1afa6dc4e754f98c69b655eed1be64b4659ffd46 Mon Sep 17 00:00:00 2001 From: Aaron Renner Date: Tue, 22 Mar 2022 21:11:42 -0600 Subject: [PATCH 2/2] Wording improvement --- guides/real_time/channels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guides/real_time/channels.md b/guides/real_time/channels.md index 8abbcfed63..f92b8dcb69 100644 --- a/guides/real_time/channels.md +++ b/guides/real_time/channels.md @@ -267,7 +267,7 @@ channel.join() export default socket ``` -After that, we need to make sure `assets/js/user_socket.js` gets imported into our application JavaScript file. To do that, uncomment the line in `assets/js/app.js`. +After that, we need to make sure `assets/js/user_socket.js` gets imported into our application JavaScript file. To do that, uncomment this line in `assets/js/app.js`. ```javascript // ...