@@ -105,13 +105,13 @@ export class LustreClientApplication {
105
105
const vdom = this . #view( this . #model) ;
106
106
const dispatch =
107
107
( handler , immediate = false ) =>
108
- ( event ) => {
109
- const result = handler ( event ) ;
108
+ ( event ) => {
109
+ const result = handler ( event ) ;
110
110
111
- if ( result instanceof Ok ) {
112
- this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
113
- }
114
- } ;
111
+ if ( result instanceof Ok ) {
112
+ this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
113
+ }
114
+ } ;
115
115
const prev =
116
116
this . root . firstChild ??
117
117
this . root . appendChild ( document . createTextNode ( "" ) ) ;
@@ -192,13 +192,13 @@ export class LustreClientApplication {
192
192
const vdom = this . #view( this . #model) ;
193
193
const dispatch =
194
194
( handler , immediate = false ) =>
195
- ( event ) => {
196
- const result = handler ( event ) ;
195
+ ( event ) => {
196
+ const result = handler ( event ) ;
197
197
198
- if ( result instanceof Ok ) {
199
- this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
200
- }
201
- } ;
198
+ if ( result instanceof Ok ) {
199
+ this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
200
+ }
201
+ } ;
202
202
const prev =
203
203
this . root . firstChild ??
204
204
this . root . appendChild ( document . createTextNode ( "" ) ) ;
@@ -228,7 +228,7 @@ export class LustreClientApplication {
228
228
composed : true ,
229
229
} ) ,
230
230
) ;
231
- const select = ( ) => { } ;
231
+ const select = ( ) => { } ;
232
232
233
233
effect ( { dispatch, emit, select } ) ;
234
234
}
@@ -380,16 +380,16 @@ export const make_lustre_client_component = (
380
380
const vdom = view ( this . #model) ;
381
381
const dispatch =
382
382
( handler , immediate = false ) =>
383
- ( event ) => {
384
- const result = handler ( event ) ;
385
-
386
- if ( result instanceof Ok ) {
387
- this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
388
- }
389
- } ;
390
- const prev = this . shadowRoot . childNodes [ this . #adoptedStyleElements. length ] ??
391
- this . shadowRoot . appendChild ( document . createTextNode ( "" ) ) ;
383
+ ( event ) => {
384
+ const result = handler ( event ) ;
392
385
386
+ if ( result instanceof Ok ) {
387
+ this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
388
+ }
389
+ } ;
390
+ const prev =
391
+ this . shadowRoot . childNodes [ this . #adoptedStyleElements. length ] ??
392
+ this . shadowRoot . appendChild ( document . createTextNode ( "" ) ) ;
393
393
394
394
morph ( prev , vdom , dispatch ) ;
395
395
}
@@ -457,19 +457,17 @@ export const make_lustre_client_component = (
457
457
const vdom = view ( this . #model) ;
458
458
const dispatch =
459
459
( handler , immediate = false ) =>
460
- ( event ) => {
461
- const result = handler ( event ) ;
460
+ ( event ) => {
461
+ const result = handler ( event ) ;
462
462
463
- if ( result instanceof Ok ) {
464
- this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
465
- }
466
- } ;
467
- const prev = this . shadowRoot . childNodes [ this . #adoptedStyleElements. length ] ??
463
+ if ( result instanceof Ok ) {
464
+ this . send ( new Dispatch ( result [ 0 ] , immediate ) ) ;
465
+ }
466
+ } ;
467
+ const prev =
468
+ this . shadowRoot . childNodes [ this . #adoptedStyleElements. length ] ??
468
469
this . shadowRoot . appendChild ( document . createTextNode ( "" ) ) ;
469
470
470
-
471
- console . log ( { prev } )
472
-
473
471
morph ( prev , vdom , dispatch ) ;
474
472
}
475
473
@@ -495,7 +493,7 @@ export const make_lustre_client_component = (
495
493
composed : true ,
496
494
} ) ,
497
495
) ;
498
- const select = ( ) => { } ;
496
+ const select = ( ) => { } ;
499
497
500
498
effect ( { dispatch, emit, select } ) ;
501
499
}
@@ -512,7 +510,7 @@ export const make_lustre_client_component = (
512
510
async #adoptStyleSheets( ) {
513
511
const pendingParentStylesheets = [ ] ;
514
512
for ( const link of document . querySelectorAll ( "link[rel=stylesheet]" ) ) {
515
- if ( link . sheet ) continue
513
+ if ( link . sheet ) continue ;
516
514
517
515
pendingParentStylesheets . push (
518
516
new Promise ( ( resolve , reject ) => {
@@ -541,7 +539,10 @@ export const make_lustre_client_component = (
541
539
try {
542
540
const adoptedSheet = new CSSStyleSheet ( ) ;
543
541
for ( const rule of sheet . cssRules ) {
544
- adoptedSheet . insertRule ( rule . cssText , adoptedSheet . cssRules . length ) ;
542
+ adoptedSheet . insertRule (
543
+ rule . cssText ,
544
+ adoptedSheet . cssRules . length ,
545
+ ) ;
545
546
}
546
547
547
548
this . shadowRoot . adoptedStyleSheets . push ( adoptedSheet ) ;
@@ -691,7 +692,7 @@ export class LustreServerApplication {
691
692
composed : true ,
692
693
} ) ,
693
694
) ;
694
- const select = ( ) => { } ;
695
+ const select = ( ) => { } ;
695
696
696
697
effect ( { dispatch, emit, select } ) ;
697
698
}
0 commit comments