MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / useInit

Function useInit

ChatGPT/src/hooks/useInit.ts:4–12  ·  view source on GitHub ↗
(callback: () => void)

Source from the content-addressed store, hash-verified

2
3// fix: Two interface requests will be made in development mode
4export default function useInit(callback: () => void) {
5 const isInit = useRef(true);
6 useEffect(() => {
7 if (isInit.current) {
8 callback();
9 isInit.current = false;
10 }
11 });
12}

Callers 15

ChatLayoutFunction · 0.85
MarkdownFunction · 0.85
SyncRecordFunction · 0.85
SyncFormFunction · 0.85
RenderPathFunction · 0.85
UserCustomFunction · 0.85
SyncPromptsFunction · 0.85
RenderPathFunction · 0.85
LangHelperFunction · 0.85
GeneralFunction · 0.85
SettingsFunction · 0.85
AboutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected