Example Hotwire App (TodoMVC) on Github - Feedback?

Hi there :wave:.

I wanted to learn more about Hotwire so built a TodoMVC app using Turbo and Stimulus. Code is available on Github. Would love any feedback.

Best,
-Donnie

1 Like

Thank you! This is a good reference for me as I learn Hotwire.

I saw this code.

            // add div to body to load turbo-stream response
            // TODO better way to do this?
            const d = document.createElement("div");
            d.innerHTML = html
            document.body.append(d)

That is clever! I would not have thought of that.

Edit

I wanted to do something similar… programmably submit an html form, and process a turbo-stream reply. I dug through the source code to see how Turbo does it. I used the following–

Turbo.navigator.submitForm(this.formTarget) // where this.formTarget is a handle to a form element within a Stimulus controller