MCPcopy Create free account
hub / github.com/microsoft/SandDance / pushEffect

Function pushEffect

docs/external/js/react-dom.development.js:15379–15408  ·  view source on GitHub ↗
(tag, create, destroy, deps)

Source from the content-addressed store, hash-verified

15377 }
15378
15379 function pushEffect(tag, create, destroy, deps) {
15380 var effect = {
15381 tag: tag,
15382 create: create,
15383 destroy: destroy,
15384 deps: deps,
15385 // Circular
15386 next: null
15387 };
15388 var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
15389
15390 if (componentUpdateQueue === null) {
15391 componentUpdateQueue = createFunctionComponentUpdateQueue();
15392 currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
15393 componentUpdateQueue.lastEffect = effect.next = effect;
15394 } else {
15395 var lastEffect = componentUpdateQueue.lastEffect;
15396
15397 if (lastEffect === null) {
15398 componentUpdateQueue.lastEffect = effect.next = effect;
15399 } else {
15400 var firstEffect = lastEffect.next;
15401 lastEffect.next = effect;
15402 effect.next = firstEffect;
15403 componentUpdateQueue.lastEffect = effect;
15404 }
15405 }
15406
15407 return effect;
15408 }
15409
15410 function mountRef(initialValue) {
15411 var hook = mountWorkInProgressHook();

Callers 2

mountEffectImplFunction · 0.85
updateEffectImplFunction · 0.85

Calls 1

Tested by

no test coverage detected