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

Function commitAllHostEffects

code/redux/public/app.js:13065–13132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13063 }
13064
13065 function commitAllHostEffects() {
13066 while (nextEffect !== null) {
13067 {
13068 ReactDebugCurrentFiber.setCurrentFiber(nextEffect);
13069 }
13070 recordEffect();
13071
13072 var effectTag = nextEffect.effectTag;
13073 if (effectTag & ContentReset) {
13074 commitResetTextContent(nextEffect);
13075 }
13076
13077 if (effectTag & Ref) {
13078 var current = nextEffect.alternate;
13079 if (current !== null) {
13080 commitDetachRef(current);
13081 }
13082 }
13083
13084 // The following switch statement is only concerned about placement,
13085 // updates, and deletions. To avoid needing to add a case for every
13086 // possible bitmap value, we remove the secondary effects from the
13087 // effect tag and switch on that value.
13088 var primaryEffectTag = effectTag & (Placement | Update | Deletion);
13089 switch (primaryEffectTag) {
13090 case Placement:
13091 {
13092 commitPlacement(nextEffect);
13093 // Clear the "placement" from effect tag so that we know that this is inserted, before
13094 // any life-cycles like componentDidMount gets called.
13095 // TODO: findDOMNode doesn't rely on this any more but isMounted
13096 // does and isMounted is deprecated anyway so we should be able
13097 // to kill this.
13098 nextEffect.effectTag &= ~Placement;
13099 break;
13100 }
13101 case PlacementAndUpdate:
13102 {
13103 // Placement
13104 commitPlacement(nextEffect);
13105 // Clear the "placement" from effect tag so that we know that this is inserted, before
13106 // any life-cycles like componentDidMount gets called.
13107 nextEffect.effectTag &= ~Placement;
13108
13109 // Update
13110 var _current = nextEffect.alternate;
13111 commitWork(_current, nextEffect);
13112 break;
13113 }
13114 case Update:
13115 {
13116 var _current2 = nextEffect.alternate;
13117 commitWork(_current2, nextEffect);
13118 break;
13119 }
13120 case Deletion:
13121 {
13122 commitDeletion(nextEffect);

Callers

nothing calls this directly

Calls 6

recordEffectFunction · 0.70
commitResetTextContentFunction · 0.70
commitDetachRefFunction · 0.70
commitPlacementFunction · 0.70
commitWorkFunction · 0.70
commitDeletionFunction · 0.70

Tested by

no test coverage detected