()
| 576 | |
| 577 | // When React mutates the host environment, we may need to change what we're listening to. |
| 578 | const commitHook = () => { |
| 579 | const nextInstanceRoots = findAllNodes(hostRoot, selectors); |
| 580 | |
| 581 | instanceRoots.forEach(target => { |
| 582 | if (nextInstanceRoots.indexOf(target) < 0) { |
| 583 | unobserve(target); |
| 584 | } |
| 585 | }); |
| 586 | |
| 587 | nextInstanceRoots.forEach(target => { |
| 588 | if (instanceRoots.indexOf(target) < 0) { |
| 589 | observe(target); |
| 590 | } |
| 591 | }); |
| 592 | }; |
| 593 | |
| 594 | commitHooks.push(commitHook); |
| 595 |
no test coverage detected