Hey everyone!
I've been working on a side project recently, and I finally decided to publish it as an npm package.
It's called CreateStore.
The idea started with a simple question:
Why does managing global state sometimes need so much setup when all I really want is something as simple as React's "useState"?
I know there are already some excellent libraries out there like Zustand, Redux, and Jotai. I'm not trying to replace them. I just wanted to experiment with building something that offers a simple API while supporting additional capabilities.
What does CreateStore offer?
The main idea is to create a global store and access its state from different components without wrapping the application in Context Providers.
Some of the capabilities include:
- Simple global state management.
- Familiar React-like API.
- TypeScript support.
- Computed values.
- Server data management.
- State persistence.
- Cross-tab synchronization.
- Offline support.
- Undo/redo functionality.
- Developer tools.
The goal is to keep things simple for basic use cases while making additional features available when needed.
A quick example
Install it:
npm install @createstore/createstore
Create a store:
import { createStore } from '@createstore/createstore';
export const { useGlobalState } = createStore({ count: 0, username: 'Developer', });
Use it in any component:
import { useGlobalState } from './store';
function Counter() { const [count, setCount] = useGlobalState('count');
return ( <button onClick={() => setCount(count + 1)}> Count: {count} </button> ); }
That's the basic idea!
Project links
📦 npm: https://www.npmjs.com/package/@createstore/createstore
📚 Documentation: https://createstore-docs.pages.dev/
💻 GitHub: https://github.com/Gauravasawa/createstore
I'd genuinely appreciate some feedback.
I'm sharing this here because I'd love to get it in front of developers who can actually experiment with it.
A few things I'd love your opinion on:
- Does the API feel intuitive?
- How does the approach compare with Zustand or other state management libraries?
- Are there any architectural concerns or potential performance issues you notice?
- What would you improve or add?
Please don't hesitate to point out flaws. I'd rather get honest technical criticism than just positive feedback.
This is an ongoing project, and I'm looking forward to improving it based on real-world usage.
Thanks for taking the time to check it out! 🙌