MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / createAutoRefreshController

Function createAutoRefreshController

src/core/auto-refresh.ts:16–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14}
15
16export function createAutoRefreshController(): AutoRefreshController {
17 let queued = false;
18
19 return {
20 onFileChange: (isIndexing: boolean) => {
21 if (isIndexing) {
22 queued = true;
23 return false;
24 }
25 return true;
26 },
27 consumeQueuedRefresh: (indexStatus) => {
28 if (indexStatus === 'indexing') {
29 // Defensive: if called while indexing, do not clear the queue.
30 return false;
31 }
32 const shouldRun = queued && indexStatus === 'ready';
33 queued = false;
34 return shouldRun;
35 },
36 reset: () => {
37 queued = false;
38 }
39 };
40}

Callers 3

createProjectStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected