@inancakduvan/keact
v1.2.1
Published
Keact is a minimal, key-based global state manager for React. No providers, no boilerplate — just a single hook to share state across your app.
Maintainers
Readme

🔑 Keact
Keact is a minimal, key-based global state manager for React. No providers, no boilerplate — just a single hook to share state across your app.
🚀 Installation
npm i @inancakduvan/keactRequires React 18 or higher.
📝 Official Documentation:
https://keact.vercel.app
✨ Features
- ✅ Zero configuration
- 🔑 Key-Based Global State Access
- ⚡ Fast and memory-efficient
- 💡 Developer-friendly API
🔧 Usage
1. The simplest way — define anywhere and use everywhere
// In any component
import { useKeact } from '@inancakduvan/keact';
// Initialize once
const [username, setUsername] = useKeact('username', {
initialValue: 'John Doe'
});
// Read elsewhere globally by key
const [username] = useKeact('username');
// Also set elsewhere globally by key
const [username, setUsername] = useKeact('username');
setUsername('George Brown');📌 That's it — no providers, no boilerplate.
2. If you need type-safety
// store.ts
import { typeSafeKeact } from "@inancakduvan/keact";
interface KeactStore {
basket: {
id: string;
count: number;
}
}
export const useKeact = typeSafeKeact<KeactStore>();
// your-component.ts
import { useKeact } from "@/store.ts";
const [basket, setBasket] = useKeact('basket');
setBasket({
id: "12345",
count: 3
});🧼 Memory efficiency
Keact adds the state into store only when it is needed. It will not consume memory until it is needed to use.
📺 A demo page:
https://keact.vercel.app/demo
📄 License
MIT
Made with ❤️ by İnanç.
