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) => {
17
17
if ( isOnCooldown && isCallQueued ) return ;
18
18
if ( isOnCooldown ) {
19
19
isCallQueued = true ;
20
+ console . log ( 'snapshot update already queued' ) ;
20
21
return ;
21
22
}
23
+ console . log ( 'no queue, updating snapshot from trigger func' ) ;
22
24
f ( ) ;
23
25
isOnCooldown = true ;
24
26
isCallQueued = false ;
@@ -27,11 +29,14 @@ export const throttle = (f, t) => {
27
29
if ( isCallQueued ) {
28
30
isCallQueued = false ;
29
31
isOnCooldown = true ; // not needed I think
32
+ console . log ( 'calling queued call' ) ;
33
+ f ( ) ;
30
34
setTimeout ( runAfterTimeout , t ) ;
31
35
return ;
32
36
}
33
37
isOnCooldown = false ;
34
38
} ;
39
+ console . log ( 'queueing snapshot update' ) ;
35
40
setTimeout ( runAfterTimeout , t ) ;
36
41
} ;
37
42
return throttledFunc ;
Original file line number Diff line number Diff line change @@ -171,6 +171,7 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
171
171
elementType ? elementType . name : 'nameless' ,
172
172
componentData ) ;
173
173
}
174
+ if ( newState !== 'stateless' ) console . log ( 'state updated:' , newState ) ;
174
175
} else {
175
176
newNode = tree ;
176
177
}
@@ -228,7 +229,12 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
228
229
devTools . onCommitFiberRoot = ( function ( original ) {
229
230
return function ( ...args ) {
230
231
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' ) ;
232
238
return original ( ...args ) ;
233
239
} ;
234
240
} ( devTools . onCommitFiberRoot ) ) ;
You can’t perform that action at this time.
0 commit comments