flowbite
flowbite copied to clipboard
Respect StreamElement.render async function
The StreamElement.render property is set to an async function in Turbo (see https://github.com/hotwired/turbo/blob/main/src/elements/stream_element.js#L29 and https://github.com/hotwired/turbo/blob/main/src/elements/stream_element.js#L167). As a result we should respect the async nature of the function and only dispatch the after render event once we know rendering has completed, by awaiting render to finish.