Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] .destroy() to return a promise #144

Closed
rgoldiez opened this issue Apr 23, 2021 · 4 comments
Closed

[FEAT] .destroy() to return a promise #144

rgoldiez opened this issue Apr 23, 2021 · 4 comments
Assignees
Labels
enhancement Extra attention is needed

Comments

@rgoldiez
Copy link

What are you trying to add to Cupertino-Pane?
We are using .destroy({ animated: true }). It would be helpful if this returned a promise that resolved once the animation is complete and the pane has been destroyed.

Is there an alternative at the latest version?
setTimeout but that isn't a great solution.

Is this related to an issue?

[ ] Yes (Give a link to the issue)
[ X ] No

@roman-rr
Copy link
Collaborator

Hello @rgoldiez thank you for issue!
You can try to use onTransitionEnd event, its should fit for your needs.

@rgoldiez
Copy link
Author

Hi @roman-rr - I'm using onTransitionEnd for other functionality. I could track destroy events and then resolve the promise over in onTransitionEnd ..... but that seems kind of messy.

@roman-rr
Copy link
Collaborator

@rgoldiez I will review possibility to covert present and destroy methods into promises functions.

@roman-rr roman-rr self-assigned this Apr 23, 2021
@roman-rr roman-rr added the enhancement Extra attention is needed label Apr 23, 2021
@roman-rr
Copy link
Collaborator

roman-rr commented May 8, 2021

@rgoldiez You can use present() and destroy() as promise in v.1.2.7

await pane.present({animate: true});
pane.present({animate: true}).then(...)

@roman-rr roman-rr closed this as completed May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants