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

Function updateValueIfChanged

code/new-context-api/public/app.js:3180–3199  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3178}
3179
3180function updateValueIfChanged(node) {
3181 if (!node) {
3182 return false;
3183 }
3184
3185 var tracker = getTracker(node);
3186 // if there is no tracker at this point it's unlikely
3187 // that trying again will succeed
3188 if (!tracker) {
3189 return true;
3190 }
3191
3192 var lastValue = tracker.getValue();
3193 var nextValue = getValueFromNode(node);
3194 if (nextValue !== lastValue) {
3195 tracker.setValue(nextValue);
3196 return true;
3197 }
3198 return false;
3199}
3200
3201var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3202

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected