0.0.1-alpha.0 • Published 3 years ago

allotize-react v0.0.1-alpha.0

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

Web Page | Demo | Book

Built with 🦀🕸 by the Allotize Team

About

Allotize 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.

📚 Read the tutorial! 📚

This tutorial is designed for kickstarting your first Allotize application.

Demo

Here is an example of Allotize in action! No servers and no complicated code.

const upvotes = document.getElementById("upvotes");
const downvote = document.getElementById("downvote");
const upvote = document.getElementById("upvote");

const votes = Allotize.Data({
    route: "cube/votes",

    data: {
        upvotes: 0,
    },

    onChange(old, new) {
        upvotes.innerHTML = new.upvotes;
    },
});

upvote.onclick = () => {
    votes.data.upvotes += 1;
};

downvote.onclick = () => {
    votes.data.upvotes -= 1;
};