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

Method prependTween

packages/2d/src/lib/code/CodeSignal.ts:286–306  ·  view source on GitHub ↗
(value: string, duration: number)

Source from the content-addressed store, hash-verified

284 }
285
286 private *prependTween(value: string, duration: number) {
287 let current = this.get();
288 const progress = createSignal(0);
289 const scope = {
290 progress,
291 fragments: [insert(value)],
292 };
293 this.set({
294 progress: current.progress,
295 fragments: [scope, ...current.fragments],
296 });
297 yield* progress(1, duration);
298 current = this.get();
299 this.set({
300 progress: current.progress,
301 fragments: current.fragments.map(fragment =>
302 fragment === scope ? value : fragment,
303 ),
304 });
305 progress.context.dispose();
306 }
307
308 public override parse(value: PossibleCodeScope): CodeScope {
309 return parseCodeScope(value);

Callers 1

prependMethod · 0.95

Calls 5

createSignalFunction · 0.90
insertFunction · 0.90
setMethod · 0.65
getMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected