diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index 15ac8218..43ba0188 100644 --- a/docs/functions/index.useRGS.html +++ b/docs/functions/index.useRGS.html @@ -10,4 +10,4 @@

Returns [T, SetStateAction<T>]

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/plugins_persist.persist.html b/docs/functions/plugins_persist.persist.html index fc7738c4..3682044c 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.

\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/utils.createHook.html b/docs/functions/utils.createHook.html index 723ede32..52ae78d3 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

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/utils.createSetter.html b/docs/functions/utils.createSetter.html index 9b00eb5e..1fdded03 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.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/utils.createSubcriber.html b/docs/functions/utils.createSubcriber.html index 561e1236..dd4f15a1 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.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/utils.initWithPlugins.html b/docs/functions/utils.initWithPlugins.html index b57b2f10..dc3604e1 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

\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/utils.useRGSWithPlugins.html b/docs/functions/utils.useRGSWithPlugins.html index b1fba152..49e617e2 100644 --- a/docs/functions/utils.useRGSWithPlugins.html +++ b/docs/functions/utils.useRGSWithPlugins.html @@ -12,4 +12,4 @@

Returns [T, SetStateAction<T>]

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/with_plugins.create.html b/docs/functions/with_plugins.create.html index 953c86a9..a6a37269 100644 --- a/docs/functions/with_plugins.create.html +++ b/docs/functions/with_plugins.create.html @@ -8,4 +8,4 @@

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

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/functions/with_plugins.withPlugins.html b/docs/functions/with_plugins.withPlugins.html index c9e07715..bc08db70 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>(key: string, value?: U, doNotInit?: boolean) => [U, SetStateAction<U>])

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

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/interfaces/plugins_persist.PersistOptions.html b/docs/interfaces/plugins_persist.PersistOptions.html index da46dc3d..5a1a40d1 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
 
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index ca18e306..341d3f07 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1,4 +1,4 @@ -index | React18 Global Store

References

Plugin +index | React18 Global Store

References

Plugin SetStateAction SetterArgType index diff --git a/docs/modules/plugins_persist.html b/docs/modules/plugins_persist.html index 2ff93c90..e3c1fff7 100644 --- a/docs/modules/plugins_persist.html +++ b/docs/modules/plugins_persist.html @@ -1,3 +1,3 @@ -plugins/persist | React18 Global Store

Index

Interfaces

PersistOptions +plugins/persist | React18 Global Store

Index

Interfaces

Functions

\ No newline at end of file diff --git a/docs/modules/utils.html b/docs/modules/utils.html index 470e0975..3d3e71e7 100644 --- a/docs/modules/utils.html +++ b/docs/modules/utils.html @@ -1,4 +1,4 @@ -utils | React18 Global Store

Index

Modules

<internal> +utils | React18 Global Store

Index

Modules

Type Aliases

Plugin SetStateAction SetterArgType diff --git a/docs/modules/with_plugins.html b/docs/modules/with_plugins.html index 900413f8..d7bbd734 100644 --- a/docs/modules/with_plugins.html +++ b/docs/modules/with_plugins.html @@ -1,4 +1,4 @@ -with-plugins | React18 Global Store

References

useRGSWithPlugins +with-plugins | React18 Global Store

References

Re-exports useRGSWithPlugins
\ No newline at end of file diff --git a/docs/types/utils.Plugin.html b/docs/types/utils.Plugin.html index 4d37207b..88c45556 100644 --- a/docs/types/utils.Plugin.html +++ b/docs/types/utils.Plugin.html @@ -1 +1 @@ -Plugin | React18 Global Store
Plugin<T>: {
    init?: ((key: string, value: T | undefined, mutate: Mutate<T>) => void);
    onChange?: ((key: string, value?: T) => void);
}

Type Parameters

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

Type Parameters

  • T
\ No newline at end of file diff --git a/docs/types/utils.SetStateAction.html b/docs/types/utils.SetStateAction.html index 532473a3..c79f2241 100644 --- a/docs/types/utils.SetStateAction.html +++ b/docs/types/utils.SetStateAction.html @@ -1 +1 @@ -SetStateAction | React18 Global Store

Type Alias SetStateAction<T>

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

Type Parameters

  • T
\ No newline at end of file +SetStateAction | React18 Global Store

Type Alias SetStateAction<T>

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

Type Parameters

  • T
\ No newline at end of file diff --git a/docs/types/utils.SetterArgType.html b/docs/types/utils.SetterArgType.html index 102c1efe..1eb8606d 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>: T | ((prevState: T) => T)

Type Parameters

  • T
\ No newline at end of file +SetterArgType | React18 Global Store

Type Alias SetterArgType<T>

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

Type Parameters

  • T
\ No newline at end of file diff --git a/docs/types/utils.ValueType.html b/docs/types/utils.ValueType.html index a573d888..6a06ec3f 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 | (() => T)

Type Parameters

  • T
\ No newline at end of file +ValueType | React18 Global Store

Type Alias ValueType<T>

ValueType<T>: T | (() => T)

Type Parameters

  • T
\ No newline at end of file diff --git a/docs/types/utils._internal_.Listener.html b/docs/types/utils._internal_.Listener.html index 34f687eb..a8fbde0c 100644 --- a/docs/types/utils._internal_.Listener.html +++ b/docs/types/utils._internal_.Listener.html @@ -1 +1 @@ -Listener | React18 Global Store
Listener: (() => void)
\ No newline at end of file +Listener | React18 Global Store
Listener: (() => void)
\ No newline at end of file diff --git a/docs/types/utils._internal_.Mutate.html b/docs/types/utils._internal_.Mutate.html index f1729918..39cbd5ba 100644 --- a/docs/types/utils._internal_.Mutate.html +++ b/docs/types/utils._internal_.Mutate.html @@ -1 +1 @@ -Mutate | React18 Global Store
Mutate<T>: ((value?: T) => void)

Type Parameters

  • T
\ No newline at end of file +Mutate | React18 Global Store
Mutate<T>: ((value?: T) => void)

Type Parameters

  • T
\ No newline at end of file diff --git a/docs/types/utils._internal_.RGS.html b/docs/types/utils._internal_.RGS.html index e14c3d56..dbf519df 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

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/types/utils._internal_.Subscriber.html b/docs/types/utils._internal_.Subscriber.html index 418b09c6..9445f50d 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))
\ No newline at end of file +Subscriber | React18 Global Store
Subscriber: ((l: Listener) => (() => void))
\ No newline at end of file diff --git a/docs/variables/utils.globalRGS.html b/docs/variables/utils.globalRGS.html index c0444576..4209ae98 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
\ No newline at end of file +globalRGS | React18 Global Store

Variable globalRGSConst

globalRGS: Record<string, undefined | RGS> = globalThisForBetterMinification.rgs
\ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebfcc802..3132029c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -253,7 +253,7 @@ importers: version: 18.3.1(react@18.3.1) tsup: specifier: ^8.1.0 - version: 8.1.0(postcss@8.4.38)(typescript@5.5.2) + version: 8.1.0(postcss@8.4.39)(typescript@5.5.2) typescript: specifier: ^5.5.2 version: 5.5.2 @@ -352,7 +352,7 @@ importers: version: 18.3.1(react@18.3.1) tsup: specifier: ^8.1.0 - version: 8.1.0(postcss@8.4.38)(typescript@5.5.2) + version: 8.1.0(postcss@8.4.39)(typescript@5.5.2) typescript: specifier: ^5.5.2 version: 5.5.2 @@ -4800,8 +4800,8 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} - postcss@8.4.38: - resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + postcss@8.4.39: + resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} engines: {node: ^10 || ^12 || >=14} preferred-pm@3.1.3: @@ -6232,8 +6232,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.1.0: - resolution: {integrity: sha512-cMojmlnwkAgIXqga+2sXshlgrrcI0QEPJ5n58pEvtuFo4PaekfomlCudArDD7hj8Hkswjl0/x4eu4q+Xa0WFgQ==} + yocto-queue@1.1.1: + resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} zwitch@2.0.4: @@ -7331,10 +7331,10 @@ snapshots: picocolors: 1.0.1 picomatch: 2.3.1 pidtree: 0.6.0 - postcss: 8.4.38 - postcss-discard-duplicates: 5.1.0(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38) - postcss-modules: 6.0.0(postcss@8.4.38) + postcss: 8.4.39 + postcss-discard-duplicates: 5.1.0(postcss@8.4.39) + postcss-load-config: 4.0.2(postcss@8.4.39) + postcss-modules: 6.0.0(postcss@8.4.39) prettier: 2.8.8 pretty-ms: 7.0.1 react-refresh: 0.14.2 @@ -8177,14 +8177,14 @@ snapshots: asynckit@0.4.0: {} - autoprefixer@10.4.19(postcss@8.4.38): + autoprefixer@10.4.19(postcss@8.4.39): dependencies: browserslist: 4.23.1 caniuse-lite: 1.0.30001638 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.1 - postcss: 8.4.38 + postcss: 8.4.39 postcss-value-parser: 4.2.0 available-typed-arrays@1.0.7: @@ -8937,9 +8937,9 @@ snapshots: esbuild-plugin-react18-css@0.0.4: dependencies: - autoprefixer: 10.4.19(postcss@8.4.38) - postcss: 8.4.38 - postcss-modules: 6.0.0(postcss@8.4.38) + autoprefixer: 10.4.19(postcss@8.4.39) + postcss: 8.4.39 + postcss-modules: 6.0.0(postcss@8.4.39) sass: 1.77.6 esbuild-plugin-react18@0.2.4(@types/react@18.3.3)(next@14.2.4(@babel/core@7.24.7)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.77.6))(react@18.3.1): @@ -9901,9 +9901,9 @@ snapshots: dependencies: safer-buffer: 2.1.2 - icss-utils@5.1.0(postcss@8.4.38): + icss-utils@5.1.0(postcss@8.4.39): dependencies: - postcss: 8.4.38 + postcss: 8.4.39 ieee754@1.2.1: {} @@ -11842,7 +11842,7 @@ snapshots: p-limit@5.0.0: dependencies: - yocto-queue: 1.1.0 + yocto-queue: 1.1.1 p-locate@4.1.0: dependencies: @@ -12014,48 +12014,48 @@ snapshots: possible-typed-array-names@1.0.0: {} - postcss-discard-duplicates@5.1.0(postcss@8.4.38): + postcss-discard-duplicates@5.1.0(postcss@8.4.39): dependencies: - postcss: 8.4.38 + postcss: 8.4.39 - postcss-load-config@4.0.2(postcss@8.4.38): + postcss-load-config@4.0.2(postcss@8.4.39): dependencies: lilconfig: 3.1.2 yaml: 2.4.5 optionalDependencies: - postcss: 8.4.38 + postcss: 8.4.39 - postcss-modules-extract-imports@3.1.0(postcss@8.4.38): + postcss-modules-extract-imports@3.1.0(postcss@8.4.39): dependencies: - postcss: 8.4.38 + postcss: 8.4.39 - postcss-modules-local-by-default@4.0.5(postcss@8.4.38): + postcss-modules-local-by-default@4.0.5(postcss@8.4.39): dependencies: - icss-utils: 5.1.0(postcss@8.4.38) - postcss: 8.4.38 + icss-utils: 5.1.0(postcss@8.4.39) + postcss: 8.4.39 postcss-selector-parser: 6.1.0 postcss-value-parser: 4.2.0 - postcss-modules-scope@3.2.0(postcss@8.4.38): + postcss-modules-scope@3.2.0(postcss@8.4.39): dependencies: - postcss: 8.4.38 + postcss: 8.4.39 postcss-selector-parser: 6.1.0 - postcss-modules-values@4.0.0(postcss@8.4.38): + postcss-modules-values@4.0.0(postcss@8.4.39): dependencies: - icss-utils: 5.1.0(postcss@8.4.38) - postcss: 8.4.38 + icss-utils: 5.1.0(postcss@8.4.39) + postcss: 8.4.39 - postcss-modules@6.0.0(postcss@8.4.38): + postcss-modules@6.0.0(postcss@8.4.39): dependencies: generic-names: 4.0.0 - icss-utils: 5.1.0(postcss@8.4.38) + icss-utils: 5.1.0(postcss@8.4.39) lodash.camelcase: 4.3.0 - postcss: 8.4.38 - postcss-modules-extract-imports: 3.1.0(postcss@8.4.38) - postcss-modules-local-by-default: 4.0.5(postcss@8.4.38) - postcss-modules-scope: 3.2.0(postcss@8.4.38) - postcss-modules-values: 4.0.0(postcss@8.4.38) + postcss: 8.4.39 + postcss-modules-extract-imports: 3.1.0(postcss@8.4.39) + postcss-modules-local-by-default: 4.0.5(postcss@8.4.39) + postcss-modules-scope: 3.2.0(postcss@8.4.39) + postcss-modules-values: 4.0.0(postcss@8.4.39) string-hash: 1.1.3 postcss-selector-parser@6.1.0: @@ -12071,7 +12071,7 @@ snapshots: picocolors: 1.0.1 source-map-js: 1.2.0 - postcss@8.4.38: + postcss@8.4.39: dependencies: nanoid: 3.3.7 picocolors: 1.0.1 @@ -13009,7 +13009,7 @@ snapshots: tslib@2.6.3: {} - tsup@8.1.0(postcss@8.4.38)(typescript@5.5.2): + tsup@8.1.0(postcss@8.4.39)(typescript@5.5.2): dependencies: bundle-require: 4.2.1(esbuild@0.21.5) cac: 6.7.14 @@ -13019,14 +13019,14 @@ snapshots: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 4.0.2(postcss@8.4.38) + postcss-load-config: 4.0.2(postcss@8.4.39) resolve-from: 5.0.0 rollup: 4.18.0 source-map: 0.8.0-beta.0 sucrase: 3.35.0 tree-kill: 1.2.2 optionalDependencies: - postcss: 8.4.38 + postcss: 8.4.39 typescript: 5.5.2 transitivePeerDependencies: - supports-color @@ -13448,7 +13448,7 @@ snapshots: vite@5.3.2(@types/node@20.14.9)(sass@1.77.6): dependencies: esbuild: 0.21.5 - postcss: 8.4.38 + postcss: 8.4.39 rollup: 4.18.0 optionalDependencies: '@types/node': 20.14.9 @@ -13660,6 +13660,6 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.1.0: {} + yocto-queue@1.1.1: {} zwitch@2.0.4: {}