You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently found myself combining multiple effects, for example haptics and sounds or more complex effects like spinning and jumping an element at the same time.
I do this by adding two changeEffect calls, like so.
I think matching the behavior is a great idea. I’ll admit that I’m not particularly picky about the name, so I’ll happily say that .combined sounds like a great choice for the API.
I've recently found myself combining multiple effects, for example haptics and sounds or more complex effects like spinning and jumping an element at the same time.
I do this by adding two
changeEffect
calls, like so.The more effects I wish to chain together the longer the code grows, and the more call-sites I need to change grow the more I tweak the animation.
Instead I'd like to propose a few options that could work, as syntax that takes two modifiers and chains them together.
The simplest is an array:
Which could even become variadics, now that they've become more powerful:
Alternatively a function like
composed(with: )
oradding(_ effect:)
could be added to compose:And lastly, perhaps using
+
operator:Thank you as always! Would love to hear what you think, and if any of those seem like a good idea.
The text was updated successfully, but these errors were encountered: