Capítulo 86 de 411

Chapter 86: Timeline.then()

Core Idea

then() returns a Promise that resolves when the timeline completes, letting you use async/await or .then() chains instead of an onComplete callback.

Reference Tables

ParameterTypeDescription
callbackFunctionoptional function to run when the promise resolves

Code Examples

await tl.play().then();
console.log("timeline finished");