File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ import 'idiomorph/dist/idiomorph-ext.js'; // https://github.com/bigskysoftware/i
33import 'htmx-ext-ws' ;
44import type { HtmxResponseInfo } from 'htmx.org' ;
55
6- type HtmxEvent = Event & { detail : HtmxResponseInfo } ;
6+ type SocketWrapper = {
7+ send : ( msg : string ) => void ;
8+ } ;
9+ type HtmxEvent = Event & { detail : HtmxResponseInfo & { socketWrapper : SocketWrapper } } ;
710
811// https://htmx.org/reference/#config
912window . htmx . config . requestClass = 'is-loading' ;
@@ -26,6 +29,6 @@ document.body.addEventListener('htmx:responseError', (event: HtmxEvent) => {
2629document . body . addEventListener ( 'htmx:wsOpen' , ( event : HtmxEvent ) => {
2730 const socket = event . detail . socketWrapper ;
2831 socket . send (
29- JSON . stringify ( { action : 'subscribe' , data : { url : window . location . href } } )
32+ JSON . stringify ( { action : 'subscribe' , data : { url : window . location . href } } ) ,
3033 ) ;
3134} ) ;
You can’t perform that action at this time.
0 commit comments