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

Feature: Add destroy manage to work with lifecycle hooks #8

Open
MartinMuzatko opened this issue Dec 7, 2017 · 2 comments
Open

Feature: Add destroy manage to work with lifecycle hooks #8

MartinMuzatko opened this issue Dec 7, 2017 · 2 comments

Comments

@MartinMuzatko
Copy link

MartinMuzatko commented Dec 7, 2017

Hello! In my app, I'm using svg-gauge and it looks wonderful!.
I would like to have a destroy function on the gauge object, to remove the gauge again. This helps to mount/unmount new templates..
Right now I have to remove the gauge container child elements on my own. Maybe there are also some eventlisteners that need to be removed

@naikus
Copy link
Owner

naikus commented Dec 8, 2017

Hello @MartinMuzatko , can you specifically tell me what you are trying to do? The gauge currently appends to the container its attached. Are you re-creating the gauge and you want to replace the existing gauge?
Thanks,
Aniket

@MartinMuzatko
Copy link
Author

Hello @naikus. Right now, I think I found a workaround to check if the gauge already exists and otherwise update the current one. I know from most components I use like this, that they provide a teardown mechanism, to remove the element and all the event-listeners for convenience.
Example:
https://flickity.metafizzy.co/api.html#destroy

Your thoughts?

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