Capítulo 86 de 411
then() returns a Promise that resolves when the timeline completes, letting you use async/await or .then() chains instead of an onComplete callback.
| Parameter | Type | Description |
|---|---|---|
callback | Function | optional function to run when the promise resolves |
await tl.play().then();
console.log("timeline finished");