You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// -------------------------CREATE TREE TO SEND TO FRONT END--------------------
48
50
/**
49
51
* This is a recursive function that runs after every Fiber commit using the following logic:
50
52
* 1. Traverse from FiberRootNode
51
53
* 2. Create an instance of custom Tree class
52
54
* 3. Build a new state snapshot
53
55
* Every time a state change is made in the accompanying app, the extension creates a Tree “snapshot” of the current state, and adds it to the current “cache” of snapshots in the extension
54
-
* @function createTree
55
56
* @param currentFiberNode A Fiber object
56
57
* @param tree A Tree object, default initialized to an instance given 'root' and 'root'
57
58
* @param fromSibling A boolean, default initialized to false
58
59
* @return An instance of a Tree object
59
60
*/
60
61
// TODO: Not sure why the ritd need to be outside of the createTree function. Want to put inside, but in case this need to be keep track for front end.
61
-
letrtidCounter=0;
62
-
63
62
exportdefaultfunctioncreateTree(
64
63
currentFiberNode: Fiber,
65
64
circularComponentTable: Set<Fiber>=newSet(),
@@ -93,22 +92,22 @@ export default function createTree(
// Save component's state and dispatch() function to our record for future time-travel state changing. Add record index to snapshot so we can retrieve.
// Save component's state and dispatch() function to our record for future time-travel state changing. Add record index to snapshot so we can retrieve.
0 commit comments