beyonk-group/svelte-carousel

(Re)initalize carousel in runtime

Closed this issue · 3 comments

I wanted to change the content of the carousel in runtime, but this isn't possible at the moment if I'm right.
I tried to modify the code, but it didn't work.

Is this possible at all without rewriting the code?

If Siema supports it, there is no reason it couldn't be done. However I don't know if Siema supports it.

Right now we pass the container to Siema during onMount so it isn't watched / updatable

However there is no issue adding an addPage or removePage method if Siema can reconfigure itself at runtime.

Hm, I'm not into Siema but I will check on it.

Btw I thought something like this:

  1. Component is created in html section and a variable is binded to it
  2. Some DOM element added to the component in the script at runtime
  3. Fire initalize function
  4. If you want to reinitalize, there will be a destroy function, and then you can initalize again

So it doesn't necessary that Siema supports reconfiguration if I get it right.

What do you think, is this possible to code?

At last I solved it an other way. I used pure siema, and then I could destroy and reinitalize the object at runtime.