diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index 10d17bd9..c2c0a6fb 100644 --- a/docs/functions/index.useRGS.html +++ b/docs/functions/index.useRGS.html @@ -10,4 +10,4 @@

Returns [T, SetStateAction<T>]

-
+
diff --git a/docs/functions/plugins_persist.persist.html b/docs/functions/plugins_persist.persist.html index 82c56513..92ed4ebd 100644 --- a/docs/functions/plugins_persist.persist.html +++ b/docs/functions/plugins_persist.persist.html @@ -1,3 +1,3 @@ persist | React18 Global Store

A plugin that persists and syncs RGS store between tabs.

+
diff --git a/docs/functions/utils.createHook.html b/docs/functions/utils.createHook.html index 25721a36..21075185 100644 --- a/docs/functions/utils.createHook.html +++ b/docs/functions/utils.createHook.html @@ -1,2 +1,2 @@ createHook | React18 Global Store

Extract coomon create hook logic to utils

-
+
diff --git a/docs/functions/utils.createSetter.html b/docs/functions/utils.createSetter.html index 3f23d718..5ce84bcf 100644 --- a/docs/functions/utils.createSetter.html +++ b/docs/functions/utils.createSetter.html @@ -1,2 +1,2 @@ createSetter | React18 Global Store

setter function to set the state.

-
+
diff --git a/docs/functions/utils.createSubcriber.html b/docs/functions/utils.createSubcriber.html index 35391a70..3c6ccd0f 100644 --- a/docs/functions/utils.createSubcriber.html +++ b/docs/functions/utils.createSubcriber.html @@ -1,2 +1,2 @@ createSubcriber | React18 Global Store

craete subscriber function to subscribe to the store.

-
+
diff --git a/docs/functions/utils.initWithPlugins.html b/docs/functions/utils.initWithPlugins.html index 2111b769..e361a6f0 100644 --- a/docs/functions/utils.initWithPlugins.html +++ b/docs/functions/utils.initWithPlugins.html @@ -1,2 +1,2 @@ initWithPlugins | React18 Global Store

Initialize the named store when invoked for the first time.

-
  • Type Parameters

    • T

    Parameters

    • key: string
    • Optionalvalue: ValueType<T>
    • plugins: Plugin<T>[] = []
    • doNotInit: boolean = false

    Returns void

+
diff --git a/docs/functions/utils.useRGSWithPlugins.html b/docs/functions/utils.useRGSWithPlugins.html index e7d53dbd..dee759c8 100644 --- a/docs/functions/utils.useRGSWithPlugins.html +++ b/docs/functions/utils.useRGSWithPlugins.html @@ -12,4 +12,4 @@

Returns [T, SetStateAction<T>]

-
+
diff --git a/docs/functions/with-plugins.create.html b/docs/functions/with-plugins.create.html index f241be19..0450df18 100644 --- a/docs/functions/with-plugins.create.html +++ b/docs/functions/with-plugins.create.html @@ -8,4 +8,4 @@

Returns () => [T, SetStateAction<T>]

-
+
diff --git a/docs/functions/with-plugins.withPlugins.html b/docs/functions/with-plugins.withPlugins.html index 7650aabe..12fd7479 100644 --- a/docs/functions/with-plugins.withPlugins.html +++ b/docs/functions/with-plugins.withPlugins.html @@ -1,4 +1,4 @@ withPlugins | React18 Global Store

Creates a hook similar to useRGS, but with plugins to be applied on first invocation.

  • Type Parameters

    • T

    Parameters

    • plugins: Plugin<T>[]

      Plugins to be applied to the store.

    Returns <U = T>(key: string, value?: U, doNotInit?: boolean) => [U, SetStateAction<U>]

    A hook that automatically initializes the store (if not already initialized) with the given plugins.

    -
+
diff --git a/docs/interfaces/plugins_persist.PersistOptions.html b/docs/interfaces/plugins_persist.PersistOptions.html index eb38271a..ab9439fd 100644 --- a/docs/interfaces/plugins_persist.PersistOptions.html +++ b/docs/interfaces/plugins_persist.PersistOptions.html @@ -1,9 +1,9 @@ -PersistOptions | React18 Global Store
interface PersistOptions {
    storage?: "local" | "session" | "cookie";
    sync?: boolean;
}

Properties

storage? +PersistOptions | React18 Global Store
interface PersistOptions {
    storage?: "local" | "session" | "cookie";
    sync?: boolean;
}

Properties

Properties

storage?: "local" | "session" | "cookie"
local
 
-
sync?: boolean
true
+
sync?: boolean
true
 
-
+
diff --git a/docs/types/utils.Plugin.html b/docs/types/utils.Plugin.html index 90466233..2b3d0858 100644 --- a/docs/types/utils.Plugin.html +++ b/docs/types/utils.Plugin.html @@ -1 +1 @@ -Plugin | React18 Global Store
Plugin: {
    init?: (key: string, value: T | undefined, mutate: Mutate<T>) => void;
    onChange?: (key: string, value?: T) => void;
}

Type Parameters

  • T
+Plugin | React18 Global Store
Plugin: {
    init?: (key: string, value: T | undefined, mutate: Mutate<T>) => void;
    onChange?: (key: string, value?: T) => void;
}

Type Parameters

  • T
diff --git a/docs/types/utils.SetStateAction.html b/docs/types/utils.SetStateAction.html index d932affd..61b9e079 100644 --- a/docs/types/utils.SetStateAction.html +++ b/docs/types/utils.SetStateAction.html @@ -1 +1 @@ -SetStateAction | React18 Global Store

Type Alias SetStateAction<T>

SetStateAction: (value: SetterArgType<T>) => void

Type Parameters

  • T
+SetStateAction | React18 Global Store

Type Alias SetStateAction<T>

SetStateAction: (value: SetterArgType<T>) => void

Type Parameters

  • T
diff --git a/docs/types/utils.SetterArgType.html b/docs/types/utils.SetterArgType.html index 6a8565da..271b5973 100644 --- a/docs/types/utils.SetterArgType.html +++ b/docs/types/utils.SetterArgType.html @@ -1 +1 @@ -SetterArgType | React18 Global Store

Type Alias SetterArgType<T>

SetterArgType: T | (prevState: T) => T

Type Parameters

  • T
+SetterArgType | React18 Global Store

Type Alias SetterArgType<T>

SetterArgType: T | (prevState: T) => T

Type Parameters

  • T
diff --git a/docs/types/utils.ValueType.html b/docs/types/utils.ValueType.html index 6ebcbca8..be75fde9 100644 --- a/docs/types/utils.ValueType.html +++ b/docs/types/utils.ValueType.html @@ -1 +1 @@ -ValueType | React18 Global Store

Type Alias ValueType<T>

ValueType: T | () => T

Type Parameters

  • T
+ValueType | React18 Global Store

Type Alias ValueType<T>

ValueType: T | () => T

Type Parameters

  • T
diff --git a/docs/types/utils._internal_.Listener.html b/docs/types/utils._internal_.Listener.html index af5920f9..c283fea3 100644 --- a/docs/types/utils._internal_.Listener.html +++ b/docs/types/utils._internal_.Listener.html @@ -1 +1 @@ -Listener | React18 Global Store
Listener: () => void
+Listener | React18 Global Store
Listener: () => void
diff --git a/docs/types/utils._internal_.Mutate.html b/docs/types/utils._internal_.Mutate.html index 194cf2c9..d621d011 100644 --- a/docs/types/utils._internal_.Mutate.html +++ b/docs/types/utils._internal_.Mutate.html @@ -1 +1 @@ -Mutate | React18 Global Store
Mutate: (value?: T) => void

Type Parameters

  • T
+Mutate | React18 Global Store
Mutate: (value?: T) => void

Type Parameters

  • T
diff --git a/docs/types/utils._internal_.RGS.html b/docs/types/utils._internal_.RGS.html index 4d6d4db4..2de4d92e 100644 --- a/docs/types/utils._internal_.RGS.html +++ b/docs/types/utils._internal_.RGS.html @@ -1,2 +1,2 @@ RGS | React18 Global Store
RGS: {
    l: Listener[];
    s: SetStateAction<unknown> | null;
    u: Subscriber;
    v: unknown;
}

This is a hack to reduce lib size + readability + not encouraging direct access to globalThis

-
+
diff --git a/docs/types/utils._internal_.Subscriber.html b/docs/types/utils._internal_.Subscriber.html index 1d42f625..a0b08585 100644 --- a/docs/types/utils._internal_.Subscriber.html +++ b/docs/types/utils._internal_.Subscriber.html @@ -1 +1 @@ -Subscriber | React18 Global Store
Subscriber: (l: Listener) => () => void
+Subscriber | React18 Global Store
Subscriber: (l: Listener) => () => void
diff --git a/docs/variables/utils.globalRGS.html b/docs/variables/utils.globalRGS.html index 9ac89be0..1b2724d7 100644 --- a/docs/variables/utils.globalRGS.html +++ b/docs/variables/utils.globalRGS.html @@ -1 +1 @@ -globalRGS | React18 Global Store

Variable globalRGSConst

globalRGS: Record<string, undefined | RGS> = globalThisForBetterMinification.rgs
+globalRGS | React18 Global Store

Variable globalRGSConst

globalRGS: Record<string, undefined | RGS> = globalThisForBetterMinification.rgs
diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 8e2191be..da1cac8b 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -14,7 +14,7 @@ "@repo/shared": "workspace:*", "next": "^15.1.0", "nextjs-darkmode": "^1.0.7", - "nextjs-themes": "^4.0.3", + "nextjs-themes": "^4.0.4", "r18gs": "workspace:*", "react": "^19.0.0", "react-dom": "^19.0.0", diff --git a/packages/shared/package.json b/packages/shared/package.json index 26a51b1c..8ebc9941 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -40,7 +40,7 @@ "@mayank1513/fork-me": "^2.1.2", "@repo/scripts": "workspace:*", "nextjs-darkmode": "^1.0.7", - "nextjs-themes": "^4.0.3", + "nextjs-themes": "^4.0.4", "r18gs": "workspace:*", "react-live": "^4.1.8", "react18-loaders": "^1.1.4" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 168d4793..12081c97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ importers: specifier: ^1.0.7 version: 1.0.7(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) nextjs-themes: - specifier: ^4.0.3 - version: 4.0.3(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + specifier: ^4.0.4 + version: 4.0.4(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) r18gs: specifier: workspace:* version: link:../../lib @@ -299,8 +299,8 @@ importers: specifier: ^1.0.7 version: 1.0.7(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) nextjs-themes: - specifier: ^4.0.3 - version: 4.0.3(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + specifier: ^4.0.4 + version: 4.0.4(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) r18gs: specifier: workspace:* version: link:../../lib @@ -4959,11 +4959,15 @@ packages: '@types/react': 16.8 - 19 react: 16.8 - 19 - nextjs-themes@4.0.3: - resolution: {integrity: sha512-aLl5ke2tOKfaqnyZ82ux3bJ9MPDm3aJnAfCQA9vZZw36TDwx3HfCfLPXyuyq6Xi7s1SoREWjRVybI+wc2LJOGg==} + nextjs-themes@4.0.4: + resolution: {integrity: sha512-AQLSsPMjrk/Z3RZtja57e1YODG/fR8f2FRiCBqacXHiLIdUwYQZ1l0ISqZSSXFhwhW36dHRSgNRpQYt7Ih8YWQ==} peerDependencies: '@types/react': 16.8 - 19 + next: 10 - 15 react: 16.8 - 19 + peerDependenciesMeta: + next: + optional: true no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -5500,16 +5504,6 @@ packages: next: optional: true - r18gs@2.0.0-alpha.0: - resolution: {integrity: sha512-AwmgZBdctfgITHVcyYLi02zLW40vcBw32eQjHRd7RRBuFDiloDuJTgnF2rzcsj/OPRP8iCosqszQ3FcBjvzQTg==} - peerDependencies: - '@types/react': 16.8 - 19 - next: '*' - react: 16.8 - 19 - peerDependenciesMeta: - next: - optional: true - r18gs@2.0.1: resolution: {integrity: sha512-0J7r+jr5DCoSD2Aero5mx30BT/7z1QDEVBANlwwnuew0NiecKQOjWyPwF0R7ZbQU6qb5hcWPPSPmHykpAnN2xA==} peerDependencies: @@ -12671,21 +12665,21 @@ snapshots: transitivePeerDependencies: - next - nextjs-themes@4.0.3(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): + nextjs-themes@4.0.4(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): dependencies: '@types/react': 19.0.1 - r18gs: 2.0.0-alpha.0(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + r18gs: 2.0.1(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) react: 19.0.0 - transitivePeerDependencies: - - next + optionalDependencies: + next: 14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) - nextjs-themes@4.0.3(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): + nextjs-themes@4.0.4(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): dependencies: '@types/react': 19.0.1 - r18gs: 2.0.0-alpha.0(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) + r18gs: 2.0.1(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0) react: 19.0.0 - transitivePeerDependencies: - - next + optionalDependencies: + next: 15.1.0(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) no-case@3.0.4: dependencies: @@ -13257,20 +13251,6 @@ snapshots: optionalDependencies: next: 15.1.0(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) - r18gs@2.0.0-alpha.0(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): - dependencies: - '@types/react': 19.0.1 - react: 19.0.0 - optionalDependencies: - next: 14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) - - r18gs@2.0.0-alpha.0(@types/react@19.0.1)(next@15.1.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): - dependencies: - '@types/react': 19.0.1 - react: 19.0.0 - optionalDependencies: - next: 15.1.0(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0) - r18gs@2.0.1(@types/react@19.0.1)(next@14.2.15(@babel/core@7.26.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.83.0))(react@19.0.0): dependencies: '@types/react': 19.0.1