https://github.com/react18-tools/zen-store
A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.
https://github.com/react18-tools/zen-store
Last synced: 6 months ago
JSON representation
A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.
- Host: GitHub
- URL: https://github.com/react18-tools/zen-store
- Owner: react18-tools
- License: mit
- Archived: true
- Created: 2024-02-20T05:46:57.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-21T13:01:00.000Z (about 2 years ago)
- Last Synced: 2024-10-02T08:58:30.621Z (over 1 year ago)
- Language: TypeScript
- Size: 84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
> Archiving this repo as npm package with similar name already exists. Please follow [React18GlobalStore](https://github.com/react18-tools/r18gs) for the latest updates.
- https://github.com/react18-tools/r18gs
# zen-store
[](https://github.com/mayank1513/zen-store/actions/workflows/test.yml) [](https://codeclimate.com/github/react18-tools/zen-store/maintainability) [](https://codecov.io/gh/mayank1513/zen-store) [](https://www.npmjs.com/package/zen-store) [](https://www.npmjs.com/package/zen-store)  [](https://gitpod.io/from-referrer/)
## Motivation
I have built wonderful libraries utilizing React18 features using Zustand. They worked awesome. However, when I try importing from specific folder for better tree-shaking, the libraries fail. This is because, for each import a separate zustand store is created. This actually increases the package size also.
Thus, I decided to create a bare minimum, ultra-light store that creates shared state even while importing components from separate files for better treeshaking.
> Will be using this library soon to fix issues with `nextjs-themes`.
## Features
✅ Full TypeScript Support
✅ Unleash the full power of React18 Server components
✅ Works with all build systems/tools/frameworks for React18
✅ Doccumented with [Typedoc](https://react18-tools.github.io/turborepo-template) ([Docs](https://react18-tools.github.io/zen-store))
✅ Next.js, Vite and Remix examples
## Install
```bash
$ pnpm add zen-store
```
or
```bash
$ npm install zen-store
```
or
```bash
$ yarn add zen-store
```
### Build
To build all apps and packages, run the following command:
```
cd zen-store
pnpm build
```
### Develop
To develop all apps and packages, run the following command:
```
cd zen-store
pnpm dev
```
## Useful Links
Learn more about the power of Turborepo:
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
### 🤩 Don't forger to start [this repo](https://github.com/mayank1513/zen-store)!
Want hands-on course for getting started with Turborepo? Check out [React and Next.js with TypeScript](https://mayank-chaudhari.vercel.app/courses/react-and-next-js-with-typescript) and [The Game of Chess with Next.js, React and TypeScrypt](https://www.udemy.com/course/game-of-chess-with-nextjs-react-and-typescrypt/?referralCode=851A28F10B254A8523FE)

## License
Licensed as MIT open source.
with 💖 by Mayank Kumar Chaudhari