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

Function updateValueIfChanged

code/styling/public/app.js:3819–3838  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

3817}
3818
3819function updateValueIfChanged(node) {
3820 if (!node) {
3821 return false;
3822 }
3823
3824 var tracker = getTracker(node);
3825 // if there is no tracker at this point it's unlikely
3826 // that trying again will succeed
3827 if (!tracker) {
3828 return true;
3829 }
3830
3831 var lastValue = tracker.getValue();
3832 var nextValue = getValueFromNode(node);
3833 if (nextValue !== lastValue) {
3834 tracker.setValue(nextValue);
3835 return true;
3836 }
3837 return false;
3838}
3839
3840var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3841

Callers 2

updateNamedCousinsFunction · 0.70
getInstIfValueChangedFunction · 0.70

Calls 2

getTrackerFunction · 0.70
getValueFromNodeFunction · 0.70

Tested by

no test coverage detected