bigskysoftware / bigskysoftware/htmx

Expose a promise to wait for, before swap

Open
#2,570 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.