File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,10 @@ export const throttle = (f, t) => {
1717 if ( isOnCooldown && isCallQueued ) return ;
1818 if ( isOnCooldown ) {
1919 isCallQueued = true ;
20+ console . log ( 'snapshot update already queued' ) ;
2021 return ;
2122 }
23+ console . log ( 'no queue, updating snapshot from trigger func' ) ;
2224 f ( ) ;
2325 isOnCooldown = true ;
2426 isCallQueued = false ;
@@ -27,11 +29,14 @@ export const throttle = (f, t) => {
2729 if ( isCallQueued ) {
2830 isCallQueued = false ;
2931 isOnCooldown = true ; // not needed I think
32+ console . log ( 'calling queued call' ) ;
33+ f ( ) ;
3034 setTimeout ( runAfterTimeout , t ) ;
3135 return ;
3236 }
3337 isOnCooldown = false ;
3438 } ;
39+ console . log ( 'queueing snapshot update' ) ;
3540 setTimeout ( runAfterTimeout , t ) ;
3641 } ;
3742 return throttledFunc ;
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
171171 elementType ? elementType . name : 'nameless' ,
172172 componentData ) ;
173173 }
174+ if ( newState !== 'stateless' ) console . log ( 'state updated:' , newState ) ;
174175 } else {
175176 newNode = tree ;
176177 }
@@ -228,7 +229,12 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
228229 devTools . onCommitFiberRoot = ( function ( original ) {
229230 return function ( ...args ) {
230231 fiberRoot = args [ 1 ] ;
231- if ( doWork ) throttledUpdateSnapshot ( ) ;
232+ console . log ( 'in CFR committed fiber' ) ;
233+ if ( doWork ) {
234+ console . log ( 'in CFR: updating snapshot' ) ;
235+ throttledUpdateSnapshot ( ) ;
236+ }
237+ console . log ( 'in CFR updated snapshot' ) ;
232238 return original ( ...args ) ;
233239 } ;
234240 } ( devTools . onCommitFiberRoot ) ) ;
You can’t perform that action at this time.
0 commit comments