@@ -112,7 +112,6 @@ export default class InlineComponentWrapper extends Wrapper {
112
112
113
113
const statements : string [ ] = [ ] ;
114
114
const updates : string [ ] = [ ] ;
115
- const postupdates : string [ ] = [ ] ;
116
115
117
116
let props ;
118
117
const name_changes = block . get_unique_name ( `${ name } _changes` ) ;
@@ -311,8 +310,6 @@ export default class InlineComponentWrapper extends Wrapper {
311
310
}
312
311
` ) ;
313
312
314
- postupdates . push ( updating ) ;
315
-
316
313
const contextual_dependencies = Array . from ( binding . expression . contextual_dependencies ) ;
317
314
const dependencies = Array . from ( binding . expression . dependencies ) ;
318
315
@@ -334,27 +331,27 @@ export default class InlineComponentWrapper extends Wrapper {
334
331
335
332
block . builders . init . add_block ( deindent `
336
333
function ${ name } (${ value } ) {
337
- if ( ctx.${ name } .call(null, ${ value } , ctx)) {
338
- ${ updating } = true;
339
- }
334
+ ctx.${ name } .call(null, ${ value } , ctx);
335
+ ${ updating } = true;
336
+ @add_flush_callback(() => ${ updating } = false);
340
337
}
341
338
` ) ;
342
339
343
340
block . maintain_context = true ; // TODO put this somewhere more logical
344
341
} else {
345
342
block . builders . init . add_block ( deindent `
346
343
function ${ name } (${ value } ) {
347
- if ( ctx.${ name } .call(null, ${ value } )) {
348
- ${ updating } = true;
349
- }
344
+ ctx.${ name } .call(null, ${ value } );
345
+ ${ updating } = true;
346
+ @add_flush_callback(() => ${ updating } = false);
350
347
}
351
348
` ) ;
352
349
}
353
350
354
351
const body = deindent `
355
352
function ${ name } (${ args . join ( ', ' ) } ) {
356
353
${ lhs } = ${ value } ;
357
- return ${ component . invalidate ( dependencies [ 0 ] ) }
354
+ ${ component . invalidate ( dependencies [ 0 ] ) } ;
358
355
}
359
356
` ;
360
357
@@ -453,8 +450,6 @@ export default class InlineComponentWrapper extends Wrapper {
453
450
else if (${ switch_value } ) {
454
451
${ name } .$set(${ name_changes } );
455
452
}
456
-
457
- ${ postupdates . length > 0 && `${ postupdates . join ( ' = ' ) } = false;` }
458
453
` ) ;
459
454
}
460
455
@@ -498,7 +493,6 @@ export default class InlineComponentWrapper extends Wrapper {
498
493
block . builders . update . add_block ( deindent `
499
494
${ updates }
500
495
${ name } .$set(${ name_changes } );
501
- ${ postupdates . length > 0 && `${ postupdates . join ( ' = ' ) } = false;` }
502
496
` ) ;
503
497
}
504
498
0 commit comments