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

onDestroy event #636

Open
RVxLab opened this issue Sep 27, 2024 · 1 comment
Open

onDestroy event #636

RVxLab opened this issue Sep 27, 2024 · 1 comment

Comments

@RVxLab
Copy link

RVxLab commented Sep 27, 2024

Would you accept a PR to add an onDestroy event?

If you add external elements that interact with Air Datepicker, it's a good idea to also clean them up.

While nothing is stopping someone from just overriding the destroy method, it's cleaner to do it via an event.

The event handler could be a void function and could be called right after the other event listeners have been cleaned up.

Thanks!

@t1m0n
Copy link
Owner

t1m0n commented Oct 30, 2024

Hi there!

Thanks for the idea, but I'm not sure if it would be very helpful. When you call destroy() you usually have a context and know where it's being called from. This allows you to control any side effects quite accurately. Maybe you have code examples where it might be really helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants