Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/crutchcorn/the-fun-framework. 🛝 An experimental homegrown JS framework. crutchcorn.github.io/the-fun-framework
Something went wrong. Try again.
Files
- TypeScript 95%
- HTML 4%
- Shell 1%
README.md
The goals of this project are:
- HTML-first templating
- No VDOM
- Implicit re-renders (instead of calling an update function manually, "mutate")
Installation #
npm install the-fun-framework
Usage #
<!-- index.html -->
<!-- You can have multiple islands in one HTML file -->
<div data-island-comp="App">
<button data-on-click="updateCount()">Count</button>
<p>Count: {{count.value}}</p>
<p data-if="count.value % 2 === 0">{{count.value}} is even</p>
</div>
// index.ts
import {
createState,
registerComponent,
render
} from "the-fun-framework";
function App() {
let count = createState(
0
);
function updateCount() {
count.value++;
}
return {
count,
updateCount
}
}
// Register with the same name as `data-island-comp`
App.selector = "App";
registerComponent(App);
render();