neuron
Home / vanilla / Create Store
Neuron stores are easy to set up and only require a key/value pair to instantiate a state. Stores are dynamic in nature and state can be added to the store any where at any time. Reading and updating non existent state will fail gracefully.
import { createStore } from "@sandstack/neuron";
export const Store = createStore();
Store.add({
key: "name",
state: "Ash Ketchum",
});
Store.add({
key: "age",
state: 10,
});
Store.js
file and keep your store logic in that file. This a suggestion, but you can do what works best given your developer needs. Neuron will work the same.