Skip to content
Discussion options

You must be logged in to vote

Hi @roderickdecorrespondent,

Good question! Event handlers in Embla will persist for the full lifecycle of the carousel instance — even across reInit calls — until the carousel is explicitly destroyed. When the Svelte component is unmounted, destroy() is automatically called, and all event handlers are cleaned up at that point:

Svelte package

destroy: () => {
if (emblaApi) emblaApi.destroy()
},

Core package used by the Svelte package

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@roderickdecorrespondent
Comment options

Answer selected by roderickdecorrespondent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
resolved This issue is resolved question Question about how to achieve something svelte Issue is related to Svelte
2 participants