Skip to content

Commit 09dcbdd

Browse files
Update JSDoc for hook examples (#3759)
* update js-interop guide * update phoenix_live_view module
1 parent f2aee92 commit 09dcbdd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

guides/client/js-interop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Then a hook callback object could be defined and passed to the socket:
183183

184184
```javascript
185185
/**
186-
* @type {Object.<string, import("phoenix_live_view").ViewHook>}
186+
* @type {import("phoenix_live_view").HooksOptions}
187187
*/
188188
let Hooks = {}
189189
Hooks.PhoneNumber = {
@@ -251,7 +251,7 @@ And then in the client:
251251
252252
```javascript
253253
/**
254-
* @type {import("phoenix_live_view").ViewHook}
254+
* @type {import("phoenix_live_view").Hook}
255255
*/
256256
Hooks.InfiniteScroll = {
257257
page() { return this.el.dataset.page },
@@ -278,7 +278,7 @@ And then on the client:
278278
279279
```javascript
280280
/**
281-
* @type {import("phoenix_live_view").ViewHook}
281+
* @type {import("phoenix_live_view").Hook}
282282
*/
283283
Hooks.Chart = {
284284
mounted(){

lib/phoenix_live_view.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ defmodule Phoenix.LiveView do
16081608
16091609
```javascript
16101610
/**
1611-
* @type {Object.<string, import("phoenix_live_view").ViewHook>}
1611+
* @type {import("phoenix_live_view").HooksOption}
16121612
*/
16131613
let Hooks = {}
16141614
Hooks.ClientHook = {

0 commit comments

Comments
 (0)