Skip to content

Commit 80e6b5d

Browse files
committed
s/connected/attached
1 parent d7039e4 commit 80e6b5d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ config :my_app, MyAppWeb.Endpoint,
3737
]
3838
```
3939

40-
Next, you'll need to listen for the `"phx:live_reload:connected"` event and enable client logging by calling the reloader's `enableServerLogs()` function, for example:
40+
Next, you'll need to listen for the `"phx:live_reload:attached"` event and enable client logging by calling the reloader's `enableServerLogs()` function, for example:
4141

4242
```javascript
43-
window.addEventListener("phx:live_reload:connected", ({detail: reloader}) => {
43+
window.addEventListener("phx:live_reload:attached", ({detail: reloader}) => {
4444
// enable server log streaming to client.
4545
// disable with reloader.disableServerLogs()
4646
reloader.enableServerLogs()
@@ -55,10 +55,10 @@ Many times it's useful to inspect the HTML DOM tree to find where markup is bein
5555
export PLUG_EDITOR="vscode://file/__FILE__:__LINE__"
5656
```
5757

58-
The `vscode://` protocol URL will open vscode with placeholders of `__FILE__:__LINE__` substited at runtime. Check your editor's documentation on protocol URL support. To open your configured editor URL when an element is clicked, say with alt-click, you can wire up an event listener within your `"phx:live_reload:connected"` callback and make use of the reloader's `openEditorAtCaller` and `openEditorAtDef` functions, passing the event target as the DOM node to reference for HEEx file:line annotation information. For example:
58+
The `vscode://` protocol URL will open vscode with placeholders of `__FILE__:__LINE__` substited at runtime. Check your editor's documentation on protocol URL support. To open your configured editor URL when an element is clicked, say with alt-click, you can wire up an event listener within your `"phx:live_reload:attached"` callback and make use of the reloader's `openEditorAtCaller` and `openEditorAtDef` functions, passing the event target as the DOM node to reference for HEEx file:line annotation information. For example:
5959

6060
```javascript
61-
window.addEventListener("phx:live_reload:connected", ({detail: reloader}) => {
61+
window.addEventListener("phx:live_reload:attached", ({detail: reloader}) => {
6262
// Enable server log streaming to client. Disable with reloader.disableServerLogs()
6363
reloader.enableServerLogs()
6464

priv/static/phoenix_live_reload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class LiveReloader {
121121
}
122122

123123
dispatchConnected(){
124-
parent.dispatchEvent(new CustomEvent("phx:live_reload:connected", {detail: this}))
124+
parent.dispatchEvent(new CustomEvent("phx:live_reload:attached", {detail: this}))
125125
}
126126

127127
log(level, str){

0 commit comments

Comments
 (0)