(hrefs, nodes, event, onLoad)
| 395 | } |
| 396 | |
| 397 | function resolveLoadables(hrefs, nodes, event, onLoad) { |
| 398 | const hrefSet = hrefs ? new Set(hrefs) : null; |
| 399 | for (let i = 0; i < nodes.length; i++) { |
| 400 | const node = nodes[i]; |
| 401 | if (loadCache.has(node)) { |
| 402 | continue; |
| 403 | } |
| 404 | const href = node.getAttribute('href'); |
| 405 | if (!hrefSet || hrefSet.has(href)) { |
| 406 | loadCache.add(node); |
| 407 | onLoad(href); |
| 408 | node.dispatchEvent(event); |
| 409 | } |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | it('can render resources before singletons', async () => { |
| 414 | const root = ReactDOMClient.createRoot(document); |
no test coverage detected