all repos — h3 @ af1f1a5943e809b4a5ebd7a4ef13c8dc612ed5dc

A tiny, extremely minimalist JavaScript microframework.

example/assets/js/components/todoList.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
import h3 from "../h3.js";
import Todo from "./todo.js";

export default function TodoList(data, actions) {
  const { start, end, filteredTodos } = data;
  const { toggleTodo, removeTodo } = actions;
  return h3(
    "div.todo-list",
    filteredTodos
      .slice(start, end)
      .map((t) => Todo(t, { toggleTodo, removeTodo }))
  );
}