all repos — h3 @ bf85a2101d1d9ed083a15ad2113836eea5490cfe

A tiny, extremely minimalist JavaScript microframework.

docs/example/assets/js/app.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
import h3 from "./h3.js";
import modules from "./modules.js";
import SettingsView from "./components/SettingsView.js";
import MainView from "./components/MainView.js";

h3.init({
  modules,
  preStart: () => {
    h3.dispatch("app/load");
    h3.dispatch("settings/set", h3.state.settings);
  },
  routes: {
    "/settings": SettingsView,
    "/": MainView,
  },
});