()
| 110 | } |
| 111 | |
| 112 | async function broadcast() { |
| 113 | const toTabs = {}; |
| 114 | let num = 0; |
| 115 | toSend::forEachEntry(groupByTab, toTabs); |
| 116 | toSend = {}; |
| 117 | for (const [tabId, frames] of Object.entries(toTabs)) { |
| 118 | for (const [frameId, toFrame] of Object.entries(frames)) { |
| 119 | if (!isEmpty(toFrame)) { |
| 120 | // Not awaiting because the tab may be busy/sleeping |
| 121 | sendTabCmd(+tabId, 'UpdatedValues', toFrame, getFrameDocIdAsObj(frameId)); |
| 122 | if (!(++num % 20)) await makePause(); // throttling |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | /** @this {Object} accumulator */ |
| 129 | function groupByTab([id, valuesToSend]) { |
nothing calls this directly
no test coverage detected