@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
Example
// current time: 0s
yield* chain(
rect.fill('#ff0000', 2),
rect.opacity(1, 1),
);
// current time: 3sNote 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),
),
);