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

Are cycle-update-view-before/after events safe to use in production code? #862

Open
pjetrucha opened this issue Feb 10, 2022 · 0 comments
Open

Comments

@pjetrucha
Copy link

Hi @malsup,
First of all I don't know if the project is still being maintained so I don't know if this is a significant question at all :)

My use case is that I want to get the index of the next slide after every slide change.
I tried the cycle-after event, but the state is not refreshed yet:

el.on('cycle-after', (e, api) => {
   api.nextSlide; // it actually returns the index of the current slide to which the transition was made
});

There is a documented cycle-update-view event, but it fires twice with each change, so still not ideal.

While browsing the code, I found the following events:
cycle-update-view-before and cycle-update-view-after which would be perfect for my use case, but I don't see them in the documentation.

Can you confirm that I can use them safely in production for my purposes?

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

1 participant