@aimform/state
Documentation coming soon.
State management built on Zustand with batteries included:
createStore— store factory with auto-injectedloading/errorswithLoading— async action wrapper with loading lifecyclesetKey— deep-set values during async operations- Immer-powered immutable updates
import { createStore, withLoading } from "@aimform/state";
const useStore = createStore(
{ items: [] },
(set, get) => ({
fetchItems: withLoading("fetchItems", async ({ setKey }) => {
setKey("items", await api.list());
}),
}),
);