all repos — h3 @ ff6cfbd8b53bff65a137f23d2cf0168c19053365

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