MCPcopy
hub / github.com/midrender/revideo / withLoader

Function withLoader

packages/ui/src/utils/withLoader.ts:8–19  ·  view source on GitHub ↗
(callback: () => Promise<unknown>)

Source from the content-addressed store, hash-verified

6 * @param callback - A function to execute.
7 */
8export async function withLoader(callback: () => Promise<unknown>) {
9 LoaderCount++;
10 document.body.classList.add('wait');
11 try {
12 await callback();
13 } finally {
14 LoaderCount--;
15 if (LoaderCount === 0) {
16 document.body.classList.remove('wait');
17 }
18 }
19}

Callers 2

openOutputPathFunction · 0.90
openFileInEditorFunction · 0.90

Calls 2

addMethod · 0.65
removeMethod · 0.45

Tested by

no test coverage detected