Is there a glideJS event for whenever the active slide changes?

Viewed 829

I have been trying to use glidejs in my react project, where I want a function to run after the active slide has changed. I have tried setting an event listener with:

glide.on('move.after', () => {
            console.log('move called')
            this.__changeActiveProject(glide.index)
        })

This way the function is called correctly, but the amount of events that are fired when I swipe the screen creates a huge amount of lag (swiping one item to the left triggers this event listener thousands of times). I have searched through the docs for an event that indicates that the active slide has changed to another slide but I cannot seem to find any event that does what I want. I have tried the move event but this has the same problem.

Is there any event that I can use that indicates that the active slide has changed?

1 Answers
Related