MCPcopy
hub / github.com/msgbyte/tianji / useWatch

Function useWatch

src/client/hooks/useWatch.ts:7–12  ·  view source on GitHub ↗
(deps: DependencyList, cb: () => void)

Source from the content-addressed store, hash-verified

5 * Listen for changes and trigger callbacks
6 */
7export function useWatch(deps: DependencyList, cb: () => void) {
8 const memoizedFn = useEvent(cb);
9 useLayoutEffect(() => {
10 memoizedFn();
11 }, deps);
12}

Callers 15

EditableText.tsxFile · 0.90
Menu.tsxFile · 0.90
index.tsxFile · 0.90
ChartRender.tsxFile · 0.90
StatusHeader.tsxFile · 0.90
Body.tsxFile · 0.90
AddServerStep.tsxFile · 0.90

Calls 1

useEventFunction · 0.90

Tested by

no test coverage detected