How do you implement optimistic UI updates using Stimulus?

I know that creating optimistic UI using VulcanJs, or Apollo and Graphql will be very easy, as Apollo provides this feature.
But how will someone create optimistic UI using Stimulus?

If someone share some code example, that will be great!

thank you!