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

Function updateValueIfChanged

code/communication/public/app.js:3854–3873  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3852}
3853
3854function updateValueIfChanged(node) {
3855 if (!node) {
3856 return false;
3857 }
3858
3859 var tracker = getTracker(node);
3860 // if there is no tracker at this point it's unlikely
3861 // that trying again will succeed
3862 if (!tracker) {
3863 return true;
3864 }
3865
3866 var lastValue = tracker.getValue();
3867 var nextValue = getValueFromNode(node);
3868 if (nextValue !== lastValue) {
3869 tracker.setValue(nextValue);
3870 return true;
3871 }
3872 return false;
3873}
3874
3875var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3876

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected