(fiber)
| 317 | } |
| 318 | |
| 319 | function run(fiber) { |
| 320 | if (!fiber) return; |
| 321 | |
| 322 | fiber.effectHooks?.forEach((newHook, index) => { |
| 323 | if(!fiber.alternate) { |
| 324 | newHook.cleanup = newHook.callback(); |
| 325 | return; |
| 326 | } |
| 327 | |
| 328 | if(!newHook.deps) { |
| 329 | newHook.cleanup = newHook.callback(); |
| 330 | } |
| 331 | |
| 332 | if (newHook.deps.length > 0) { |
| 333 | const oldHook = fiber.alternate?.effectHooks[index]; |
| 334 | |
| 335 | if(!isDepsEqual(oldHook.deps, newHook.deps)) { |
| 336 | newHook.cleanup = newHook.callback() |
| 337 | } |
| 338 | } |
| 339 | }); |
| 340 | |
| 341 | run(fiber.child); |
| 342 | run(fiber.sibling); |
| 343 | } |
| 344 | |
| 345 | runCleanup(wipRoot); |
| 346 | run(wipRoot); |
no test coverage detected