MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / runCleanup

Function runCleanup

mini-react/src/mini-react.js:304–317  ·  view source on GitHub ↗
(fiber)

Source from the content-addressed store, hash-verified

302
303 function commitEffectHooks() {
304 function runCleanup(fiber){
305 if (!fiber) return;
306
307 fiber.alternate?.effectHooks?.forEach((hook, index)=>{
308 const deps = fiber.effectHooks[index].deps;
309
310 if (!hook.deps || !isDepsEqual(hook.deps, deps)) {
311 hook.cleanup?.();
312 }
313 })
314
315 runCleanup(fiber.child);
316 runCleanup(fiber.sibling);
317 }
318
319 function run(fiber) {
320 if (!fiber) return;

Callers 1

commitEffectHooksFunction · 0.85

Calls 1

isDepsEqualFunction · 0.85

Tested by

no test coverage detected