I've written the TodoMVC app with my new framework...
# htmx-general
g
I've written the TodoMVC app with my new framework https://www.npmjs.com/package/htmxx ... got everything working except being able to delete an item from the UI once the DELETE response returns and also clearing the text field after creating a new todo. Both cases use the approach
_="on htmx:afterOnLoad ..."
The input clearing code is
Copy code
<form
  hx-post="/todos"
  hx-target="#todo-list"
  hx-swap="afterbegin"
  _="on htmx:afterOnLoad set #txtTodo.value to ''"
>
  <input
    class="new-todo"
    id="txtTodo"
    name="todo"
    placeholder="What needs to be done?"
    autofocus=""
  />
</form>
and the row deleting code is
Copy code
<button
  class="destroy"
  hx-delete="/todos/{{id}}"
  _="on htmx:afterOnLoad remove #todo-{{id}}"
></button>
What have I missed? (there's no errors in the console)