MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / updateValueIfChanged

Function updateValueIfChanged

code/third-party/public/app.js:3052–3071  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3050}
3051
3052function updateValueIfChanged(node) {
3053 if (!node) {
3054 return false;
3055 }
3056
3057 var tracker = getTracker(node);
3058 // if there is no tracker at this point it's unlikely
3059 // that trying again will succeed
3060 if (!tracker) {
3061 return true;
3062 }
3063
3064 var lastValue = tracker.getValue();
3065 var nextValue = getValueFromNode(node);
3066 if (nextValue !== lastValue) {
3067 tracker.setValue(nextValue);
3068 return true;
3069 }
3070 return false;
3071}
3072
3073var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3074

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected