Skip to Content

@revideo/core


@revideo/core / flow / chain

Function: chain()

chain(…tasks): ThreadGenerator

Defined in: flow/chain.ts:38 

Run tasks one after another.

Parameters

tasks

…(Callback | ThreadGenerator)[]

A list of tasks to run.

Returns

ThreadGenerator

Example

// current time: 0s yield* chain( rect.fill('#ff0000', 2), rect.opacity(1, 1), ); // current time: 3s

Note that the same animation can be written as:

yield* rect.fill('#ff0000', 2), yield* rect.opacity(1, 1),

The reason chain exists is to make it easier to pass it to other flow functions. For example:

yield* all( rect.radius(20, 3), chain( rect.fill('#ff0000', 2), rect.opacity(1, 1), ), );
© 2026 Haven Technologies, Inc.
Function: chain() – Revideo