@iadev93/zuno-react
v0.0.12
Published
<p><b>Idiomatic React bindings for Zuno.</b></p>
Maintainers
Readme
@iadev93/zuno-react
This package provides deep integration with React using useSyncExternalStore for performance and consistency.
Install
npm install @iadev93/zuno-reactPeer dependency:
react >= 18
Usage
import { createZunoReact } from "@iadev93/zuno-react";
const zuno = createZunoReact({
// Optional: Enable batching
batchSync: true,
});
const counter = zuno.store(
"counter",
() => 0,
undefined,
// Optional: Custom equality
(a, b) => a === b
);
function App() {
const value = counter.use();
return <button onClick={() => counter.set(v => v + 1)}>{value}</button>;
}Features
- No Context
- No Provider
- Fine‑grained subscriptions
- Selector + equality support
- SSR‑safe via
useSyncExternalStore
Design Rules
- React adapter never mutates core
- React adapter never owns state
- React adapter only subscribes
If you’re using Zuno in a real project, please open an issue and tell us your use case.
License
MIT
