all repos — h3 @ 68daa6a4f7e8660bb651e52e6d2a171984f568ad

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]),
    ]);
}