-
-
Notifications
You must be signed in to change notification settings - Fork 885
Open
Labels
featurefeature request to implementfeature request to implement
Description
I want to play an animation and wait until it finishes. I checked the docs and tutorials and I did not find an API that returns a promise or something.
It seems there's no related discussion here so I would like it to ask if there's a standard way of doing this?
What I am doing now is wrapping it in a promise and it works fine:
const burstPromise = new Promise(resolve => {
const burst = new mojs.Burst({
radius: {30: 120},
count: 10,
children: {
duration: 3000,
},
onComplete() {
resolve();
}
});
burst.play();
});
await burstPromise;
Metadata
Metadata
Assignees
Labels
featurefeature request to implementfeature request to implement