Start your All-Access Pass to unlock this challenge
How does the function renderStreamMessage() work?
renderStreamMessage()
renderStreamMessage() takes a Response object from a fetch function and processes the response in order to make changes to your page.
fetch
renderStreamMessage() takes a plain string as an argument and uses your page's flash alerts container to append it to the list of flash messages. Basically a client side version of the Symfony flash message feature.
renderStreamMessage() takes a Turbo Stream formatted HTML as a string and immediately processes it in order to change different parts of you page on demand.
renderStreamMessage() takes a plain string as an argument and pops up a nicely styled dialog and a close button, similar to SweetAlert.