Skip to content

Commit

Permalink
Merge pull request #6 from react18-tools/patch-fix-ts-error
Browse files Browse the repository at this point in the history
Fix typescript error.
  • Loading branch information
mayank1513 authored Feb 25, 2024
2 parents b238a2e + 5929a52 commit 7a89082
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React18GlobalStore

[![test](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/a79e66d0da36cb9a86b6/maintainability)](https://codeclimate.com/github/react18-tools/reacr18-global-store/maintainability) [![codecov](https://codecov.io/gh/react18-tools/react18-global-store/graph/badge.svg)](https://codecov.io/gh/react18-tools/react18-global-store) [![Version](https://img.shields.io/npm/v/r18gs.svg?colorB=green)](https://www.npmjs.com/package/r18gs) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/r18gs.svg)](https://www.npmjs.com/package/r18gs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/r18gs) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
[![test](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/ec3140063acd8df82481/maintainability)](https://codeclimate.com/github/react18-tools/react18-global-store/maintainability) [![codecov](https://codecov.io/gh/react18-tools/react18-global-store/graph/badge.svg)](https://codecov.io/gh/react18-tools/react18-global-store) [![Version](https://img.shields.io/npm/v/r18gs.svg?colorB=green)](https://www.npmjs.com/package/r18gs) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/r18gs.svg)](https://www.npmjs.com/package/r18gs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/r18gs) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)

## Motivation

Expand Down
8 changes: 8 additions & 0 deletions examples/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# nextjs-example

## 0.0.5

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 0.0.4

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-example",
"version": "0.0.4",
"version": "0.0.5",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -10,18 +10,18 @@
"postinstall": "next telemetry disable"
},
"dependencies": {
"@mayank1513/fork-me": "latest",
"r18gs": "workspace:*",
"@mayank1513/fork-me": "^2.0.1",
"next": "^14.1.0",
"nextjs-themes": "^2.1.1",
"nextjs-themes": "^2.1.2",
"r18gs": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@next/eslint-plugin-next": "^14.1.0",
"@types/node": "^20.11.19",
"@types/react": "^18.2.56",
"@types/node": "^20.11.20",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"eslint-config-custom": "workspace:*",
"tsconfig": "workspace:*",
Expand Down
8 changes: 8 additions & 0 deletions examples/remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# remix-example

## 0.0.5

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 0.0.4

### Patch Changes
Expand Down
24 changes: 12 additions & 12 deletions examples/remix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remix-example",
"version": "0.0.4",
"version": "0.0.5",
"private": true,
"sideEffects": false,
"type": "module",
Expand All @@ -11,24 +11,24 @@
"typecheck": "tsc"
},
"dependencies": {
"@mayank1513/fork-me": "latest",
"r18gs": "workspace:*",
"@remix-run/css-bundle": "^2.6.0",
"@remix-run/node": "^2.6.0",
"@remix-run/react": "^2.6.0",
"@remix-run/serve": "^2.6.0",
"@mayank1513/fork-me": "^2.0.1",
"@remix-run/css-bundle": "^2.7.2",
"@remix-run/node": "^2.7.2",
"@remix-run/react": "^2.7.2",
"@remix-run/serve": "^2.7.2",
"isbot": "5.1.0",
"nextjs-themes": "^2.1.1",
"nextjs-themes": "^2.1.2",
"r18gs": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@remix-run/dev": "^2.6.0",
"@remix-run/eslint-config": "^2.6.0",
"@types/react": "^18.2.56",
"@remix-run/dev": "^2.7.2",
"@remix-run/eslint-config": "^2.7.2",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"typescript": "^5.3.3"
},
"engines": {
Expand Down
8 changes: 8 additions & 0 deletions examples/vite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# vite-example

## 0.0.5

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 0.0.4

### Patch Changes
Expand Down
16 changes: 8 additions & 8 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-example",
"private": true,
"version": "0.0.4",
"version": "0.0.5",
"type": "module",
"scripts": {
"dev": "vite --port 3001",
Expand All @@ -10,23 +10,23 @@
"preview": "vite preview"
},
"dependencies": {
"@mayank1513/fork-me": "latest",
"@mayank1513/fork-me": "^2.0.1",
"nextjs-themes": "^2.1.2",
"r18gs": "workspace:*",
"nextjs-themes": "^2.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"shared-ui": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.2.56",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-react-swc": "^3.6.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.3.3",
"vite": "^5.1.3"
"vite": "^5.1.4"
}
}
6 changes: 6 additions & 0 deletions lib/r18gs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# r18gs

## 0.0.5

### Patch Changes

- Fix Typescript error

## 0.0.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion lib/r18gs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React18GlobalStore

[![test](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/a79e66d0da36cb9a86b6/maintainability)](https://codeclimate.com/github/react18-tools/reacr18-global-store/maintainability) [![codecov](https://codecov.io/gh/react18-tools/react18-global-store/graph/badge.svg)](https://codecov.io/gh/react18-tools/react18-global-store) [![Version](https://img.shields.io/npm/v/r18gs.svg?colorB=green)](https://www.npmjs.com/package/r18gs) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/r18gs.svg)](https://www.npmjs.com/package/r18gs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/r18gs) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
[![test](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/react18-global-store/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/ec3140063acd8df82481/maintainability)](https://codeclimate.com/github/react18-tools/react18-global-store/maintainability) [![codecov](https://codecov.io/gh/react18-tools/react18-global-store/graph/badge.svg)](https://codecov.io/gh/react18-tools/react18-global-store) [![Version](https://img.shields.io/npm/v/r18gs.svg?colorB=green)](https://www.npmjs.com/package/r18gs) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/r18gs.svg)](https://www.npmjs.com/package/r18gs) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/r18gs) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)

## Motivation

Expand Down
10 changes: 5 additions & 5 deletions lib/r18gs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "r18gs",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"private": false,
"version": "0.0.4",
"version": "0.0.5",
"description": "A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.",
"main": "./index.ts",
"types": "./index.ts",
Expand All @@ -26,11 +26,11 @@
"devDependencies": {
"@testing-library/react": "^14.2.1",
"@turbo/gen": "^1.12.4",
"@types/node": "^20.11.19",
"@types/react": "^18.2.56",
"@types/node": "^20.11.20",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.3.0",
"@vitest/coverage-v8": "^1.3.1",
"eslint-config-custom": "workspace:*",
"jsdom": "^24.0.0",
"octokit": "^3.1.2",
Expand All @@ -40,7 +40,7 @@
"typedoc": "^0.25.8",
"typescript": "^5.3.3",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.3.0"
"vitest": "^1.3.1"
},
"peerDependencies": {
"@types/react": "16.8 - 18",
Expand Down
2 changes: 1 addition & 1 deletion lib/r18gs/src/use-rgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export default function useRGS<T>(key: string, value?: T): [T, (val: SetterArgTy
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- temp fix
const getSnapshot = () => (globalThis.rgs[key]?.value ?? value) as T;

const val = useSyncExternalStore<T>(subscribe, getSnapshot, () => value);
const val = useSyncExternalStore<T>(subscribe, getSnapshot, () => value as T);
return [val, setRGState];
}
12 changes: 6 additions & 6 deletions packages/shared-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
"lint": "eslint ."
},
"devDependencies": {
"@mayank1513/fork-me": "latest",
"r18gs": "workspace:*",
"@types/node": "^20.11.19",
"@types/react": "^18.2.56",
"@mayank1513/fork-me": "^2.0.1",
"@types/node": "^20.11.20",
"@types/react": "^18.2.58",
"@types/react-dom": "^18.2.19",
"eslint-config-custom": "workspace:*",
"next": "^14.1.0",
"nextjs-themes": "^2.1.1",
"nextjs-themes": "^2.1.2",
"r18gs": "workspace:*",
"react": "^18.2.0",
"tsconfig": "workspace:*",
"typescript": "5.3.3"
},
"dependencies": {
"eslint": "^8.56.0"
"eslint": "^8.57.0"
}
}

0 comments on commit 7a89082

Please sign in to comment.