@@ -21,6 +21,7 @@ import Tree from './tree';
21
21
import componentActionsRecord from './masterState' ;
22
22
import { throttle , getHooksNames } from './helpers' ;
23
23
import { Console } from 'console' ;
24
+ import AtomsRelationship from '../app/components/AtomsRelationship' ;
24
25
25
26
// Set global variables to use in exported module and helper functions
26
27
declare global {
@@ -31,14 +32,12 @@ declare global {
31
32
let fiberRoot = null ;
32
33
let doWork = true ;
33
34
const circularComponentTable = new Set ( ) ;
34
- let allAtomsRelationship = [ ] ;
35
35
let isRecoil = false ;
36
36
37
37
// Simple check for whether our target app uses Recoil
38
38
if ( window [ `$recoilDebugStates` ] ) {
39
39
isRecoil = true ;
40
40
}
41
-
42
41
function getRecoilState ( ) : any {
43
42
const RecoilSnapshotsLength = window [ `$recoilDebugStates` ] . length ;
44
43
const lastRecoilSnapshot =
@@ -155,6 +154,7 @@ function traverseHooks(memoizedState: any): HookStates {
155
154
return hooksStates ;
156
155
}
157
156
157
+ let allAtomsRelationship = [ ] ;
158
158
/**
159
159
* @method createTree
160
160
* @param currentFiber A Fiber object
@@ -178,6 +178,7 @@ function createTree(
178
178
179
179
// These have the newest state. We update state and then
180
180
// called updateSnapshotTree()
181
+
181
182
const {
182
183
sibling,
183
184
stateNode,
@@ -192,14 +193,21 @@ function createTree(
192
193
treeBaseDuration,
193
194
} = currentFiber ;
194
195
196
+ if ( typeof currentFiber . elementType === "function" && currentFiber . elementType . name === "RecoilRoot" ) {
197
+ // console.log(currentFiber.memoizedState.next.memoizedState.current.getState())
198
+ }
199
+
200
+
201
+
195
202
if (
196
203
currentFiber . memoizedState &&
197
204
currentFiber . memoizedState . next &&
198
205
currentFiber . memoizedState . next . memoizedState &&
199
206
currentFiber . memoizedState . next . memoizedState . deps
200
207
) {
201
-
208
+ // console.log(currentFiber)
202
209
let pointer = currentFiber . memoizedState . next ;
210
+
203
211
while ( pointer !== null ) {
204
212
if ( ! Array . isArray ( pointer . memoizedState ) ) {
205
213
let componentName = currentFiber . elementType . name
@@ -208,6 +216,13 @@ function createTree(
208
216
}
209
217
pointer = pointer . next
210
218
}
219
+
220
+ if ( currentFiber . memoizedState . next . memoizedState . deps [ 1 ] . current ) {
221
+ let getState = currentFiber . memoizedState . next . memoizedState . deps [ 1 ] . current . getState ( )
222
+ console . log ( getState . graphsByVersion . entries ( ) )
223
+ }
224
+
225
+
211
226
}
212
227
213
228
let newState : any | { hooksState ?: any [ ] } = { } ;
0 commit comments