all repos — h3 @ a10856afd1e8a04af2a7f9914b657984a56787a5

A tiny, extremely minimalist JavaScript microframework.

docs/example/assets/js/components/MainView.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
import { h3, h } 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 h("div.container", [
        h("h1", "To Do List"),
        h("main", [AddTodoForm, EmptyTodoError, NavigationBar, TodoList]),
    ]);
}