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

Function updateValueIfChanged

code/redux/public/app.js:4070–4089  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

4068}
4069
4070function updateValueIfChanged(node) {
4071 if (!node) {
4072 return false;
4073 }
4074
4075 var tracker = getTracker(node);
4076 // if there is no tracker at this point it's unlikely
4077 // that trying again will succeed
4078 if (!tracker) {
4079 return true;
4080 }
4081
4082 var lastValue = tracker.getValue();
4083 var nextValue = getValueFromNode(node);
4084 if (nextValue !== lastValue) {
4085 tracker.setValue(nextValue);
4086 return true;
4087 }
4088 return false;
4089}
4090
4091var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
4092

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected