hadal
v0.1.32
Published
Framework for building decentralized web appications
Downloads
11
Readme
Hadal is a JavaScript library for building web apps without server infrastructure.
Built with 🦀🕸 by the Hadal Team
About
Hadal is an attempt of building a data management pattern very much like Vuex/Redux, but where we are also able to share data/state/information with remote machines. The project is essentially composed of two major modules, a database and a P2P networking solution.
This tutorial is designed for kickstarting your first Hadal application. Checkout the API docs for a deep dive into the internals!
Demo
Here is an example of Hadal in action! No servers and no complicated code.
let votes = {
route: "cube/votes",
state: {
upvotes: 0,
},
onStateChange(oldState, newState) {
document.getElementById("upvotes").innerHTML = newState.upvotes;
},
};
document.getElementById("upvote").addEventListener('click', (e) => {
votes.state.upvotes += 1;
});
document.getElementById("downvote").addEventListener('click', (e) => {
votes.state.upvotes -= 1;
});
Hadal.Connect(votes);