Aimform

@aimform/state

Documentation coming soon.

State management built on Zustand with batteries included:

  • createStore — store factory with auto-injected loading/errors
  • withLoading — async action wrapper with loading lifecycle
  • setKey — 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());
    }),
  }),
);

On this page