Feature Request: Support for Repeated Effect.
Addallah opened this issue · comments
I couldn't get the animation to work with .repeatForever()
.
I would love if there was a way to trigger the Effect every 2 seconds for example
Hey @Addallah, would you be able to provide more context about your use case? Normally I would suggest updating the piece of state that triggers your animation on a timer that fires every two seconds rather than trying to repeat the animation forever, but I'd love to understand more about what you're trying to do to see if there's a worthwhile addition to the library that should be made.
Thanks a lot!
The solution that i ended up with.
.onAppear { _ = Timer.scheduledTimer(withTimeInterval: 5, repeats: true) { _ in withAnimation { shine.toggle() } } }
Screen.Recording.2024-02-11.at.9.28.06.PM.mov
Hey @Addallah, apologies that I hadn't responded I accidentally closed the tab and this issue went missing from Github Notifications. I love what you came up with, it looks great! And your solution looks great, it's pretty much exactly what I was suggesting above, well done. 😄