The Neuron Global State Manager is a small, bare bones, framework agnostic library for building framework specific global state managers.
Neuron Core can be used in any js application by itself or you can tailor it to your framework of choice. My goal is to create framework specific version of this that use core under the hood. See React Neuron as an example.
Warning: This library is still experimental and is not ready for production.
import { Neuron } from "@sandstack/neuron";
const trainer = new Neuron("Ash Ketchum");
trainer.set("Gary Oak");
const name = trainer.getRef();
trainer.effect((payload) => {
console.log(payload.state);
});
//initial console.log output
//name: Ash Ketchum
//new console.log output
//name: Gary Oak
Learn more about Neuron Core and React Neuron.