Lacspace
Loading
Global state in ~1 KB
Sharing state across components without prop-drilling or a Context provider — and when Redux/MobX feel like too much. Also great for state you need to read or write from outside React.
Create a store, use selectors, no provider — built on useSyncExternalStore with a persist middleware and shallow equality. A Zustand-lite that also works outside React.
$ npm install @lacspace/storeconst useStore = create((set) => ({ n: 0 }))create(initializer)Returns a `useStore` hook + attached getState/setState/subscribe.createStore(initializer)The vanilla, framework-agnostic store (no React).useStore(selector?, equalityFn?)Subscribe to the whole state or a selected slice.persist(initializer, options)localStorage/sessionStorage middleware with partialize + version.shallow(a, b)One-level equality for multi-value selectors.