MCPcopy Create free account
hub / github.com/bytebase/bytebase / load

Function load

frontend/src/react/hooks/useSheetStatement.ts:105–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104 let canceled = false;
105 const load = async () => {
106 try {
107 const sheet = await useAppStore
108 .getState()
109 .getOrFetchSheetByName(sheetName);
110 if (canceled || !sheet) {
111 return;
112 }
113 setSnapshot(snapshotOfSheet(sheet));
114 } finally {
115 if (!canceled) {
116 setSnapshot((prev) =>
117 prev.isLoading ? { ...prev, isLoading: false } : prev
118 );
119 }
120 }
121 };
122 void load();
123 return () => {
124 canceled = true;

Callers 1

useSheetStatementFunction · 0.70

Calls 1

snapshotOfSheetFunction · 0.85

Tested by

no test coverage detected