You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
###**A Modern, Lightweight, and High-Performance State Management Library for React**
11
+
> **_⚡Kosha_**:**A Modern, Lightweight, and High-Performance State Management Library for React**
12
12
13
13
**Kosha** is a production-ready, minimalistic global state management solution for modern React applications. At just **\~450 bytes minzipped**, it's optimized for performance-critical applications, full React 18+ support, and clean developer ergonomics.
14
14
@@ -21,6 +21,7 @@ Live demo: [https://kosha-six.vercel.app](https://kosha-six.vercel.app)
Koshaprovidesaconvenient**immermiddleware**tosimplifyimmutablestateupdatesbyenablingyoutowritemutativelogicinsidethestoresetter. Itinternallyapplies`immer`'s `produce` function automatically.
189
+
190
+
Exampleusage:
191
+
192
+
```ts
193
+
import { create } from "kosha";
194
+
import { immer } from "kosha/middleware";
195
+
196
+
const useKosha = create(
197
+
immer(set => ({
198
+
todos: [],
199
+
addTodo: (item: string) =>
200
+
set(state => {
201
+
state.todos.push(item); // safe mutable update with immer middleware
No — inKosha, you’recomparingoutputsofthesameselectorfunction across renders. Since the order of keys in JavaScript objects is preserved in deterministic function outputs, JSON.stringify remains stable and reliable in this context.
0 commit comments