@@ -193,10 +193,32 @@ While `Date` serializes fine, **avoid storing `Set` or `Map`** directly in globa
193193
194194## 🚧 Known Limitations
195195
196- Kosha is intentionally minimal , and with that comes tradeoffs :
196+ Kosha is intentionally minimal by design — built to offer just what most React apps need , without bloat . That comes with a few tradeoffs :
197197
198- - ** Selector Comparison via ` JSON.stringify ` ** : Fast and reliable for most use cases , but not suitable for diffing non - serializable objects like ` Set ` , ` Map ` , or very large / deep objects . Having said that , it works excellently well with moderately large / deep objects
199- - ** Limited Built - in Plugins ** : Middleware architecture is in place , but plugin ecosystem is early . You can write your own ` devtools ` , etc .
198+ ### 🧠 Selector Comparison via ` JSON.stringify `
199+
200+ Kosha uses ` JSON.stringify ` internally to compare selector outputs for change detection . This works extremely well for the majority of cases — even with moderately large or deeply nested selectors .
201+
202+ However , there are a few caveats :
203+
204+ - ** Avoid non - serializable values ** in selectors like ` Set ` , ` Map ` , ` WeakMap ` , or circular objects .
205+ - ** Very large selector outputs ** may incur performance costs during diffing .
206+
207+ > To clarify :
208+ > ✅ It ’s perfectly fine to have a large store or global state .
209+ > ⚠️ What matters is the ** output of your selector ** . If you ’re selecting a large slice like ` state => ({ a: state.a, ..., z: state.z }) ` , it ’s more efficient to either :
210+ >
211+ > - Access the store directly without a selector (` useKosha() ` ), or
212+ > - Extract only the minimal fields you actually need .
213+
214+ ### 🔌 Plugin Ecosystem Still Growing
215+
216+ Kosha includes full support for custom middleware and already ships with a working [persist middleware ](https :// github.com/mayank1513/kosha/blob/main/lib/src/middleware/persist.ts). However:
217+
218+ - Built - in plugins like ` devtools ` are not yet included .
219+ - A community - driven plugin ecosystem is still in its early stages .
220+
221+ > That said , the underlying architecture is solid and middleware - ready — you ' re free to build and compose your own middleware as needed.
200222
201223-- -
202224
0 commit comments