MCPcopy Create free account
hub / github.com/microsoft/SandDance / updateCallback

Function updateCallback

docs/external/js/react-dom.development.js:15555–15572  ·  view source on GitHub ↗
(callback, deps)

Source from the content-addressed store, hash-verified

15553 }
15554
15555 function updateCallback(callback, deps) {
15556 var hook = updateWorkInProgressHook();
15557 var nextDeps = deps === undefined ? null : deps;
15558 var prevState = hook.memoizedState;
15559
15560 if (prevState !== null) {
15561 if (nextDeps !== null) {
15562 var prevDeps = prevState[1];
15563
15564 if (areHookInputsEqual(nextDeps, prevDeps)) {
15565 return prevState[0];
15566 }
15567 }
15568 }
15569
15570 hook.memoizedState = [callback, nextDeps];
15571 return callback;
15572 }
15573
15574 function mountMemo(nextCreate, deps) {
15575 var hook = mountWorkInProgressHook();

Callers 3

updateTransitionFunction · 0.85
rerenderTransitionFunction · 0.85

Calls 2

updateWorkInProgressHookFunction · 0.85
areHookInputsEqualFunction · 0.85

Tested by

no test coverage detected