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

Add a dispose() method to Docsify to clean up the instance #1719

Open
trusktr opened this issue Jan 12, 2022 · 0 comments
Open

Add a dispose() method to Docsify to clean up the instance #1719

trusktr opened this issue Jan 12, 2022 · 0 comments

Comments

@trusktr
Copy link
Member

trusktr commented Jan 12, 2022

Feature request

Add a dispose() method so that Docsify can be cleaned up when no longer needed.

What problem does this feature solve?

This is needed for embedding Docsify (#799) on sites that switch to and from a view that has a Docsify instance (maybe they have multiple Docsify instances on different pages).

People currently can not clean up the instance when they will no longer render it.

What does the proposed API look like?

// later
window.$docsify.dispose() // or similar

and for people who will use the Docsify class directly,

const docsify = new Docsify(...)

// later
docsify.dispose()

How should this be implemented in your opinion?

Add a dispose method that cleans up route change listeners, anchor link click handlers, etc.

@trusktr trusktr changed the title Add a dispose() method to Docsify to clean up the instance when no longer needed. Add a dispose() method to Docsify to clean up the instance Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant