bigskysoftware / bigskysoftware/htmx
Expose a promise to wait for, before swap
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
I am trying to write an extension where an animation is started on the target, like a fade out, while the html request is also starting. We then wait till both the animation ended and the request is finished, before swapping the content (which can start a second animation on the target, like a fade in.
For now I can only achieve this by swapping the content myself, and ignoring all the settings that came in through all the htmx attriburtes on an element.
None of the events or extension functions can wait for a promise. And the swap function itself is also not exposed.
For now I do not see a way top achieve my whish.
Looking at the code I think that exposing a promise (or the resolve/reject methods of a promise), that is waited for before swap, will be the easiest way to make it possible what I like to do.
Keep up the good work!
Contributor guide
Assessment
This issue has not been assessed yet.