How can I setTimeout on a loop? #624
herunan
started this conversation in
4. General
Replies: 1 comment 2 replies
-
You can use x-init to start your setTimeout logic |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I currently have a card on my website which renders one object at a time as it loops through an array of objects. It currently responds to a click event but I'd like for it to automatically loop through the array based on time (e.g. using a setTimeout). Is this something that I can do using AlpineJS or do I need to do an external function call? If so, how?
It's a Rails-AlpineJS project. Feel free to criticise the code.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions