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

Function updateValueIfChanged

code/composition/public/app.js:3957–3976  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3955}
3956
3957function updateValueIfChanged(node) {
3958 if (!node) {
3959 return false;
3960 }
3961
3962 var tracker = getTracker(node);
3963 // if there is no tracker at this point it's unlikely
3964 // that trying again will succeed
3965 if (!tracker) {
3966 return true;
3967 }
3968
3969 var lastValue = tracker.getValue();
3970 var nextValue = getValueFromNode(node);
3971 if (nextValue !== lastValue) {
3972 tracker.setValue(nextValue);
3973 return true;
3974 }
3975 return false;
3976}
3977
3978var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3979

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected