A watchable store unit
npm install store-unitimport { Store } from "store-unit";
const initialValue = { count: 42 };
const store = new Store(initialValue);
const unlisten = store.on("change", (newState, previousState) => {
updateSomething(state);
});
// Stop listening:
unlisten();