Skip to content

Commit b5405b2

Browse files
committed
linkFiber comments
1 parent ca83448 commit b5405b2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

package/linkFiber.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
/**
22
* This file contains core module functionality.
3-
*
3+
*
44
* It exports an anonymous
55
* @function
66
* that is invoked on
77
* @param snap --> Current snapshot
88
* @param mode --> Current mode (jumping i.e. time-traveling, locked, or paused)
99
* and @returns a function to be invoked on the rootContainer HTMLElement
10-
*
10+
*
1111
* @function updateSnapShotTree
1212
* --> Middleware #1: Updates snap object with latest snapshot
13-
*
13+
*
1414
* @function sendSnapshot
1515
* --> Middleware #2: Gets a copy of the current snapshot state tree and posts it to the window
16-
*
16+
*
1717
* @function changeSetState
1818
* @param component : stateNode property on a stateful class component's FiberNode object
1919
* --> Binds class component setState method to the component
2020
* --> Injects middleware into class component's setState method
21-
*
21+
*
2222
* @function changeUseState
2323
* @param component : memoizedState property on a stateful functional component's FiberNode object
2424
* --> Binds functional component dispatch method to the component
2525
* --> Injects middleware into component's dispatch method
2626
* Note: dispatch is hook equivalent to setState()
27-
*
27+
*
2828
* @function traverseHooks
29-
* @param memoizedState : memoizedState property on a stateful functional component's FiberNode object
29+
* @param memoizedState : memoizedState property on a stateful fctnl component's FiberNode object
3030
* --> Helper function to traverse through memoizedState
3131
* --> Invokes @changeUseState on each stateful functional component
32-
*
32+
*
3333
* @function createTree
3434
* @param currentFiber : a FiberNode object
3535
* --> Recursive function to traverse from FiberRootNode and create
@@ -92,7 +92,7 @@ module.exports = (snap, mode) => {
9292
component.queue.dispatch = (fiber, queue, action) => {
9393
if (mode.locked && !mode.jumping) return;
9494
oldDispatch(fiber, queue, action);
95-
// * Uncomment setTimeout to prevent snapshot lag-effect
95+
// * Uncomment setTimeout to prevent snapshot lag-effect
9696
// * (i.e. getting the prior snapshot on each state change)
9797
// setTimeout(() => {
9898
updateSnapShotTree();
@@ -147,8 +147,8 @@ module.exports = (snap, mode) => {
147147

148148
// Check if the component uses hooks
149149
if (
150-
memoizedState &&
151-
Object.hasOwnProperty.call(memoizedState, 'baseState')
150+
memoizedState
151+
&& Object.hasOwnProperty.call(memoizedState, 'baseState')
152152
) {
153153
// 'catch-all' for suspense elements (experimental)
154154
if (typeof elementType.$$typeof === 'symbol') return;
@@ -190,7 +190,7 @@ module.exports = (snap, mode) => {
190190
}
191191

192192
return async container => {
193-
// Point fiberRoot to FiberRootNode
193+
// Point fiberRoot to FiberRootNode
194194
if (container._internalRoot) {
195195
fiberRoot = container._internalRoot;
196196
concurrent = true;

0 commit comments

Comments
 (0)