File tree Expand file tree Collapse file tree 3 files changed +640
-656
lines changed
client/reactive/components/rewritten Expand file tree Collapse file tree 3 files changed +640
-656
lines changed Original file line number Diff line number Diff line change 2323 < button id ="change ">
2424 Change AEs
2525 </ button >
26+ < button id ="delete ">
27+ Delete all AEs
28+ </ button >
2629 </ div >
2730 </ div >
2831
Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ export default class AexprTest extends Morph {
1313 this . x = new Poll ( 4 ) ;
1414 this . createButton . addEventListener ( 'click' , ( ) => this . addAE ( ) ) ;
1515 this . changeButton . addEventListener ( 'click' , ( ) => this . changeAEs ( ) ) ;
16+ this . deleteButton . addEventListener ( 'click' , ( ) => this . deleteAEs ( ) ) ;
1617 }
1718
1819 addAE ( ) {
1920 let z = 4 ;
2021 this . aes . push ( aexpr ( ( ) => this . x . getBestOption ( ) + this . y + z ) ) ;
22+ this . aes . push ( aexpr ( ( ) => this . x . getBestOption ( ) + this . y + z ) ) ;
2123 z ++ ;
2224 }
2325
@@ -26,6 +28,13 @@ export default class AexprTest extends Morph {
2628 this . y ++ ;
2729 }
2830
31+ deleteAEs ( ) {
32+ for ( const ae of this . aes ) {
33+ ae . dispose ( ) ;
34+ }
35+ this . aes = [ ] ;
36+ }
37+
2938 get createButton ( ) {
3039 return this . get ( "#create" ) ;
3140 }
@@ -34,6 +43,10 @@ export default class AexprTest extends Morph {
3443 return this . get ( "#change" ) ;
3544 }
3645
46+ get deleteButton ( ) {
47+ return this . get ( "#delete" ) ;
48+ }
49+
3750 async livelyExample ( ) { }
3851
3952}
You can’t perform that action at this time.
0 commit comments