Skip to content

Commit 73f1961

Browse files
authored
Merge pull request #25 from react18-tools/feat/support-initializer
Feat/support initializer
2 parents 285ab35 + ccccfe8 commit 73f1961

13 files changed

Lines changed: 69 additions & 12 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ I've developed fantastic libraries leveraging React18 features using Zustand, an
88

99
As a solution, I set out to create a lightweight, bare minimum store that facilitates shared state even when importing components from separate files, optimizing tree-shaking.
1010

11+
> If you need fully featured state management solution, consider using Zustand with [`treeshakable`](https://github.com/react18-tools/treeshakable/)
12+
> To understand the issue with treeshakability and importing from subpath, see - <https://treeshakable.vercel.app>
13+
1114
## Features
1215

1316
✅ Full TypeScript Support
@@ -28,6 +31,12 @@ Utilize this hook similarly to the `useState` hook. However, ensure to pass a un
2831
const [state, setState] = useRGS<number>("counter", 1);
2932
```
3033

34+
**_or_**
35+
36+
```tsx
37+
const [state, setState] = useRGS<number>("counter", () => 1);
38+
```
39+
3140
> For detailed instructions, see [Getting Started](./md-docs/1.getting-started.md)
3241
3342
## Using Plugins

SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ We provide support for the latest minor version. Pull requests aimed at fixing s
66

77
| Version | Support Status |
88
| ------- | ------------------ |
9-
| 1.0.x | :white_check_mark: |
10-
| 0.2.x | :warning: |
11-
| < 0.2 | :x: |
9+
| 1.1.x | :white_check_mark: |
10+
| 1.0.x | :warning: |
11+
| < 1.0 | :x: |
1212

1313
## Patching Long-Term Support (LTS) Versions
1414

examples/nextjs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# nextjs-example
22

3+
## 0.0.15
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- r18gs@1.1.0
9+
- shared-ui@0.0.0
10+
311
## 0.0.14
412

513
### Patch Changes

examples/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-example",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

examples/remix/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# remix-example
22

3+
## 0.0.15
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- r18gs@1.1.0
9+
- shared-ui@0.0.0
10+
311
## 0.0.14
412

513
### Patch Changes

examples/remix/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remix-example",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"private": true,
55
"sideEffects": false,
66
"type": "module",

examples/vite/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# vite-example
22

3+
## 0.0.15
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- r18gs@1.1.0
9+
- shared-ui@0.0.0
10+
311
## 0.0.14
412

513
### Patch Changes

examples/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vite-example",
33
"private": true,
4-
"version": "0.0.14",
4+
"version": "0.0.15",
55
"type": "module",
66
"scripts": {
77
"dev": "vite --port 3001",

lib/r18gs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# r18gs
22

3+
## 1.1.0
4+
5+
### Minor Changes
6+
7+
- Support initializer function. Now you can initialize the RGStore by supplying a function in place of constant.
8+
39
## 1.0.2
410

511
### Patch Changes

lib/r18gs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "r18gs",
33
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
44
"private": false,
5-
"version": "1.0.2",
5+
"version": "1.1.0",
66
"description": "A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.",
77
"main": "./dist/index.js",
88
"types": "./dist/index.d.ts",

0 commit comments

Comments
 (0)