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

Function useThread

packages/core/src/utils/useThread.ts:9–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 * Get a reference to the current thread.
8 */
9export function useThread(): Thread {
10 const thread = ThreadStack.at(-1);
11 if (!thread) {
12 throw new DetailedError(
13 'The thread is not available in the current context.',
14 // language=markdown
15 `\`useThread()\` can only be called from within generator functions.
16 It's not available during rendering.`,
17 );
18 }
19 return thread;
20}
21
22export function startThread(thread: Thread) {
23 ThreadStack.push(thread);

Callers 14

setPlaybackRateFunction · 0.90
playFunction · 0.90
constructorMethod · 0.90
waitForFunction · 0.90
loopFunction · 0.90
loopForFunction · 0.90
joinFunction · 0.90
useTimeFunction · 0.90
beginSlideFunction · 0.90
springFunction · 0.90
tweenFunction · 0.90
threads.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected