@@ -127,7 +127,7 @@ async function reconcileNewTables(
127127 }
128128 } , { } as Record < string , HTMLPerspectiveViewerElement [ ] > ) ;
129129
130- const tasks = [ ] ;
130+ // const tasks = [];
131131
132132 /// reconcile the two sets of tables into the final tables set.
133133 const names = new Set ( [ ...Object . keys ( next ) , ...prev . keys ( ) ] ) ;
@@ -142,39 +142,28 @@ async function reconcileNewTables(
142142 if ( p === undefined ) {
143143 throw new Error ( "Unreachable." ) ;
144144 }
145- tasks . push (
146- ( async ( ) => {
147- await Promise . all (
148- usedViewers . map ( ( v ) => {
149- return v . eject ( ) ;
150- } )
151- ) ;
152- workspace . removeTable ( name ) ;
153- } ) ( )
145+ await Promise . all (
146+ usedViewers . map ( ( v ) => {
147+ return v . eject ( ) ;
148+ } )
154149 ) ;
150+ workspace . removeTable ( name ) ;
155151 } else if ( prev . get ( name ) === undefined ) {
156152 // A table was added that did not exist in the previous set.
157- tasks . push (
158- ( async ( ) => {
159- await workspace . addTable ( name , next [ name ] ) ;
160- } ) ( )
161- ) ;
153+ await workspace . addTable ( name , next [ name ] ) ;
162154 } else {
163155 // the table for `name` was remapped.
164156 // eject and then reload viewers using [n]
165- tasks . push (
166- ( async ( ) => {
167- await Promise . all (
168- usedViewers . map ( async ( v ) => {
169- await v . eject ( ) ;
170- await v . load ( next [ name ] ) ;
171- } )
172- ) ;
173- await workspace . replaceTable ( name , next [ name ] ) ;
174- } ) ( )
157+
158+ await Promise . all (
159+ usedViewers . map ( async ( v ) => {
160+ await v . eject ( ) ;
161+ await v . load ( next [ name ] ) ;
162+ } )
175163 ) ;
164+ await workspace . replaceTable ( name , next [ name ] ) ;
176165 }
177166 }
178167
179- await Promise . all ( tasks ) ;
168+ // await Promise.all(tasks);
180169}
0 commit comments