MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / Observer

Function Observer

graph-ui/src/system/useSystemPoll.test.tsx:106–110  ·  view source on GitHub ↗
({ read, paused }: { read: () => Promise<number>; paused: boolean })

Source from the content-addressed store, hash-verified

104 it('never exposes the previous scope before passive effects or while paused', async () => {
105 const seen: Array<number | null> = [];
106 function Observer({ read, paused }: { read: () => Promise<number>; paused: boolean }) {
107 const reading = useSystemPoll(read, true, paused, 100);
108 useLayoutEffect(() => { seen.push(reading.data); });
109 return <output>{JSON.stringify(reading)}</output>;
110 }
111 const readA = vi.fn().mockResolvedValue(42), readB = vi.fn().mockResolvedValue(99);
112 await act(async () => { root.render(<Observer read={readA} paused={false} />); });
113 expect(state().data).toBe(42);

Callers

nothing calls this directly

Calls 2

useSystemPollFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected