@@ -186,7 +186,7 @@ class Tests extends React.Component<DevToolProps, State> {
186186 * Every setState call will have to go through this, otherwise we get race conditions
187187 * where the underlying state has changed, but the draftState didn't change.
188188 */
189- setStateDebounced = (
189+ setStateDelayedFlush = (
190190 setStateFunc :
191191 | Partial < State >
192192 | ( ( state : State , props : DevToolProps ) => Partial < State > ) ,
@@ -222,7 +222,7 @@ class Tests extends React.Component<DevToolProps, State> {
222222
223223 UNSAFE_componentWillReceiveProps ( nextProps : DevToolProps ) {
224224 if ( nextProps . sandboxId !== this . props . sandboxId ) {
225- this . setStateDebounced (
225+ this . setStateDelayedFlush (
226226 {
227227 files : { } ,
228228 selectedFilePath : null ,
@@ -238,7 +238,7 @@ class Tests extends React.Component<DevToolProps, State> {
238238 }
239239
240240 selectFile = ( file : File ) => {
241- this . setStateDebounced (
241+ this . setStateDelayedFlush (
242242 state => ( {
243243 selectedFilePath :
244244 file . fileName === state . selectedFilePath ? null : file . fileName ,
@@ -248,7 +248,7 @@ class Tests extends React.Component<DevToolProps, State> {
248248 } ;
249249
250250 toggleFileExpansion = ( file : File ) => {
251- this . setStateDebounced (
251+ this . setStateDelayedFlush (
252252 oldState =>
253253 immer ( oldState , state => {
254254 state . fileExpansionState [ file . fileName ] = ! state . fileExpansionState [
@@ -283,7 +283,7 @@ class Tests extends React.Component<DevToolProps, State> {
283283 if ( this . props . updateStatus ) {
284284 this . props . updateStatus ( 'clear' ) ;
285285 }
286- this . setStateDebounced ( INITIAL_STATE , 0 ) ;
286+ this . setStateDelayedFlush ( INITIAL_STATE , 0 ) ;
287287 break ;
288288 }
289289 case 'test_count' : {
@@ -299,7 +299,7 @@ class Tests extends React.Component<DevToolProps, State> {
299299 if ( this . props . updateStatus ) {
300300 this . props . updateStatus ( 'clear' ) ;
301301 }
302- this . setStateDebounced (
302+ this . setStateDelayedFlush (
303303 {
304304 running : true ,
305305 } ,
@@ -308,7 +308,7 @@ class Tests extends React.Component<DevToolProps, State> {
308308 break ;
309309 }
310310 case messages . TOTAL_TEST_END : {
311- this . setStateDebounced (
311+ this . setStateDelayedFlush (
312312 {
313313 running : false ,
314314 } ,
@@ -338,7 +338,7 @@ class Tests extends React.Component<DevToolProps, State> {
338338 }
339339
340340 case messages . ADD_FILE : {
341- this . setStateDebounced ( oldState =>
341+ this . setStateDelayedFlush ( oldState =>
342342 immer ( oldState , state => {
343343 state . files [ data . path ] = {
344344 tests : { } ,
@@ -351,7 +351,7 @@ class Tests extends React.Component<DevToolProps, State> {
351351 break ;
352352 }
353353 case 'remove_file' : {
354- this . setStateDebounced ( oldState =>
354+ this . setStateDelayedFlush ( oldState =>
355355 immer ( oldState , state => {
356356 if ( state . files [ data . path ] ) {
357357 delete state . files [ data . path ] ;
@@ -363,7 +363,7 @@ class Tests extends React.Component<DevToolProps, State> {
363363 break ;
364364 }
365365 case messages . FILE_ERROR : {
366- this . setStateDebounced ( oldState =>
366+ this . setStateDelayedFlush ( oldState =>
367367 immer ( oldState , state => {
368368 if ( state . files [ data . path ] ) {
369369 state . files [ data . path ] . fileError = data . error ;
@@ -383,7 +383,7 @@ class Tests extends React.Component<DevToolProps, State> {
383383 case messages . ADD_TEST : {
384384 const testName = [ ...this . currentDescribeBlocks , data . testName ] ;
385385
386- this . setStateDebounced ( oldState =>
386+ this . setStateDelayedFlush ( oldState =>
387387 immer ( oldState , state => {
388388 if ( ! state . files [ data . path ] ) {
389389 state . files [ data . path ] = {
@@ -409,7 +409,7 @@ class Tests extends React.Component<DevToolProps, State> {
409409 const { test } = data ;
410410 const testName = [ ...test . blocks , test . name ] ;
411411
412- this . setStateDebounced ( oldState =>
412+ this . setStateDelayedFlush ( oldState =>
413413 immer ( oldState , state => {
414414 if ( ! state . files [ test . path ] ) {
415415 state . files [ test . path ] = {
@@ -440,7 +440,7 @@ class Tests extends React.Component<DevToolProps, State> {
440440 const { test } = data ;
441441 const testName = [ ...test . blocks , test . name ] ;
442442
443- this . setStateDebounced ( oldState =>
443+ this . setStateDelayedFlush ( oldState =>
444444 immer ( oldState , state => {
445445 if ( ! state . files [ test . path ] ) {
446446 return ;
@@ -529,22 +529,22 @@ class Tests extends React.Component<DevToolProps, State> {
529529 } ;
530530
531531 toggleWatching = ( ) => {
532- this . setStateDebounced ( state => ( { watching : ! state . watching } ) , 0 ) ;
532+ this . setStateDelayedFlush ( state => ( { watching : ! state . watching } ) , 0 ) ;
533533 dispatch ( {
534534 type : 'set-test-watching' ,
535535 watching : ! this . state . watching ,
536536 } ) ;
537537 } ;
538538
539539 runAllTests = ( ) => {
540- this . setStateDebounced ( { files : { } } , 0 ) ;
540+ this . setStateDelayedFlush ( { files : { } } , 0 ) ;
541541 dispatch ( {
542542 type : 'run-all-tests' ,
543543 } ) ;
544544 } ;
545545
546546 runTests = ( file : File ) => {
547- this . setStateDebounced (
547+ this . setStateDelayedFlush (
548548 oldState =>
549549 immer ( oldState , state => {
550550 if ( state . files [ file . fileName ] ) {
0 commit comments