MCPcopy Index your code
hub / github.com/handsontable/handsontable / flush

Function flush

docs/src/plugins/framework-loader.mjs:1659–1689  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1657 };
1658
1659 const flush = async () => {
1660 flushTimer = null;
1661
1662 // A previous batch is still running — retry shortly so we never run
1663 // two passes concurrently.
1664 if (flushing) {
1665 flushTimer = setTimeout(flush, 50);
1666
1667 return;
1668 }
1669
1670 flushing = true;
1671
1672 const batch = [...pending.entries()];
1673
1674 pending.clear();
1675
1676 for (const [absPath, type] of batch) {
1677 try {
1678 await handleChange(absPath, type);
1679 } catch (err) {
1680 logger.warn(`framework-loader: failed to reload ${absPath}: ${err.message}`);
1681 }
1682 }
1683
1684 flushing = false;
1685
1686 if (pending.size > 0) {
1687 flushTimer = setTimeout(flush, 50);
1688 }
1689 };
1690
1691 const queueChange = type => (changedPath) => {
1692 if (!changedPath.startsWith(watchRoot)) return;

Callers

nothing calls this directly

Calls 3

entriesMethod · 0.80
handleChangeFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…