qortex-store-react
v2.2.0
Published
React bindings for qortex-store state management
Maintainers
Readme
⚛️ qortex-store-react
React bindings for qortex-store ⚡
✨ Features
- ⚛️ React 18+ — concurrent-mode safe with optimized subscriptions
- 🎯 Selector support — only re-render when your selected slice changes
- 🪶 Tiny — single hook, minimal overhead
- 🔐 Type-safe — full TypeScript generics
npm install qortex-store-react🚀 Quick Start
import { createStore, useStore } from "qortex-store-react";
// Create a store (do this outside components)
const counterStore = createStore((set, get) => ({
count: 0,
increment: () => set({ count: get().count + 1 }),
}));
function Counter() {
// Select only what you need
const count = useStore(counterStore, (s) => s.count);
const increment = useStore(counterStore, (s) => s.increment);
return <button onClick={increment}>Count: {count}</button>;
}📖 Documentation
Complete documentation, examples, and API reference available at:
🌐 qortex.darshannaik.com
📖 API
useStore(store, selector?, equalityFn?)
| Param | Type | Default | Description |
|-------------|------------------------------|--------------|-------------------------------------|
| store | Store<T> | required | Store created with createStore |
| selector | (state: T) => U | identity | Pick a slice of state |
| equalityFn | (a: U, b: U) => boolean | Object.is | Custom equality to skip re-renders |
Returns the selected state U, kept in sync with the store.
📄 License
LGPL-3.0 — see LICENSE.
🎯 Support
Need help? Have questions? Want to chat about state management strategies?
- 📚 Documentation: qortex.darshannaik.com
- 📧 Email: darshannaik.com
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 🌟 Repository: https://github.com/Darshan-Naik/qortex
