Global state made as simple as useState, with zero config, built-in async caching, and automatic scoping.
عن هذا المشروع
React Shared States Global state made as simple as useState, with zero config, built-in async caching, and automatic scoping. Tiny, ergonomic, convention‑over‑configuration state, async function, and real-time subscription sharing for React. Global by default, trivially scoped when you need isolation, and opt‑in static APIs when you must touch state outside components. As simple as useState, as flexible as Zustand, without boilerplate like Redux. 🔥 Why this instead of Redux / Zustand / Context soup? 0 config. Just pick a key: useSharedState('cart', []). Automatic scoping: nearest SharedStatesProvider wins; omit it for global. Cross‑tree sharing via named scopes (two providers with same scopeName share data) – powerful for portals/modals/micro‑frontends. Async functions become cached shared resources via useSharedFunction (built‑in loading, error, results, reentrancy guard, manual or forced refresh). Static APIs (sharedStatesApi, sharedFunctionsApi) let you prime / read / mutate outside React (SSR, event buses, dev tools, tests). No custom store objects, reducers, actions, selectors, immer, proxies, or serialization hoops. Predictable: key + scope ⇒ value. That’s it. Install or
من ملف README الخاص بالمشروع على
GitHub
أضف هذه الشارة إلى ملف README
أظهر أن مشروعك مُدرج على «صُنع في الجزائر».
[](https://www.madeinalgeria.dev/projects/react-shared-states)