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

Function updateValueIfChanged

code/dependency-injection/public/app.js:3912–3931  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3910}
3911
3912function updateValueIfChanged(node) {
3913 if (!node) {
3914 return false;
3915 }
3916
3917 var tracker = getTracker(node);
3918 // if there is no tracker at this point it's unlikely
3919 // that trying again will succeed
3920 if (!tracker) {
3921 return true;
3922 }
3923
3924 var lastValue = tracker.getValue();
3925 var nextValue = getValueFromNode(node);
3926 if (nextValue !== lastValue) {
3927 tracker.setValue(nextValue);
3928 return true;
3929 }
3930 return false;
3931}
3932
3933var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3934

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected