all repos — h3 @ ba38ad5b41611b5e2ca05614a0acecfca29350f3

A tiny, extremely minimalist JavaScript microframework.

example/assets/js/components/MainView.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
import h3 from "../h3.js";
import AddTodoForm from "./AddTodoForm.js";
import EmptyTodoError from "./EmptyTodoError.js";
import NavigationBar from "./NavigationBar.js";
import TodoList from "./TodoList.js";

export default function () {
  const { todos, filter } = h3.state();
  h3.dispatch("todos/filter", filter);
  h3.dispatch("app/save", { todos: todos, settings: h3.state("settings") });
  return h3("div.container", [
    h3("h1", "To Do List"),
    h3("main", [AddTodoForm, EmptyTodoError, NavigationBar, TodoList]),
  ]);
}