Skip to content

Commit 273cc31

Browse files
authored
Fix missing examples (#6321)
1 parent 59dcde3 commit 273cc31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

assets/js/phoenix/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* events are listened for, messages are pushed to the server, and
2727
* the channel is joined with ok/error/timeout matches:
2828
*
29-
* ```javascript
29+
* ```
3030
* let channel = socket.channel("room:123", {token: roomToken})
3131
* channel.on("new_msg", msg => console.log("Got message", msg) )
3232
* $input.onEnter( e => {
@@ -82,7 +82,7 @@
8282
* Lifecycle events of the multiplexed connection can be hooked into via
8383
* `socket.onError()` and `socket.onClose()` events, ie:
8484
*
85-
* ```javascript
85+
* ```
8686
* socket.onError( () => console.log("there was an error with the connection!") )
8787
* socket.onClose( () => console.log("the connection dropped") )
8888
* ```
@@ -93,7 +93,7 @@
9393
* For each joined channel, you can bind to `onError` and `onClose` events
9494
* to monitor the channel lifecycle, ie:
9595
*
96-
* ```javascript
96+
* ```
9797
* channel.onError( () => console.log("there was an error!") )
9898
* channel.onClose( () => console.log("the channel has gone away gracefully") )
9999
* ```
@@ -121,7 +121,7 @@
121121
* To sync presence state from the server, first instantiate an object and
122122
* pass your channel in to track lifecycle events:
123123
*
124-
* ```javascript
124+
* ```
125125
* let channel = socket.channel("some:topic")
126126
* let presence = new Presence(channel)
127127
* ```
@@ -130,7 +130,7 @@
130130
* from the server. For example, to render the list of users every time
131131
* the list changes, you could write:
132132
*
133-
* ```javascript
133+
* ```
134134
* presence.onSync(() => {
135135
* myRenderUsersFunction(presence.list())
136136
* })
@@ -150,7 +150,7 @@
150150
* each user. This could be the first tab they opened, or the first device
151151
* they came online from:
152152
*
153-
* ```javascript
153+
* ```
154154
* let listBy = (id, {metas: [first, ...rest]}) => {
155155
* first.count = rest.length + 1 // count of this user's presences
156156
* first.id = id
@@ -164,7 +164,7 @@
164164
* The `presence.onJoin` and `presence.onLeave` callbacks can be used to
165165
* react to individual presences joining and leaving the app. For example:
166166
*
167-
* ```javascript
167+
* ```
168168
* let presence = new Presence(channel)
169169
*
170170
* // detect if user has joined for the 1st time or from another tab/device

0 commit comments

Comments
 (0)