diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index 0d290f64..e9c42b3c 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 071b47bf..794195ff 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 26022178..d1372eb6 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 f890e86f..1d83ee0e 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 0bc80daa..0b8c988f 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 751eadcb..7e734e85 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 e0a41a08..a10791ac 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 5e97eca1..41cda590 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 1edea242..c7a927f7 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 4ed2b3c7..361ad2be 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 b2ee32df..d5f27588 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 05374c69..33fd69a5 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 64099388..ea0a6993 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 e164fb72..c26dd6d8 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 d43182a8..c079d515 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 d6927167..7d63f373 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 cb71f43d..480a391c 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 3b17b65c..371f0229 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 bbc27733..f88ee8f4 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/pnpm-lock.yaml b/pnpm-lock.yaml index 1686dd23..3b0ef7fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2541,8 +2541,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001687: - resolution: {integrity: sha512-0S/FDhf4ZiqrTUiQ39dKeUjYRjkv7lOZU1Dgif2rIqrTzX/1wV2hfKu9TOm1IHkdSijfLswxTFzl/cvir+SLSQ==} + caniuse-lite@1.0.30001688: + resolution: {integrity: sha512-Nmqpru91cuABu/DTCXbM2NSRHzM2uVHfPnhJ/1zEAJx/ILBRVmz3pzH4N7DZqbdG0gWClsCC05Oj0mJ/1AWMbA==} capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -3912,8 +3912,8 @@ packages: resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==} engines: {node: '>= 0.4'} - is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + is-data-view@1.0.2: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} engines: {node: '>= 0.4'} is-date-object@1.0.5: @@ -4016,8 +4016,8 @@ packages: is-reference@3.0.3: resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} - is-regex@1.2.0: - resolution: {integrity: sha512-B6ohK4ZmoftlUe+uvenXSbPJFo6U37BH7oO1B3nQH8f/7h27N56s85MhUtbFJAziz5dcmuR3i8ovUl35zp8pFA==} + is-regex@1.2.1: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} is-relative@1.0.0: @@ -4136,8 +4136,8 @@ packages: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} - iterator.prototype@1.1.3: - resolution: {integrity: sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ==} + iterator.prototype@1.1.4: + resolution: {integrity: sha512-x4WH0BWmrMmg4oHHl+duwubhrvczGlyuGAZu3nvrf0UXOfPu8IhZObFEr7DE/iv01YgVZrsOiRcqw2srkKEDIA==} engines: {node: '>= 0.4'} jackspeak@2.3.6: @@ -5753,8 +5753,8 @@ packages: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} engines: {node: '>=6'} - safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + safe-array-concat@1.1.3: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} safe-buffer@5.1.2: @@ -9159,7 +9159,7 @@ snapshots: autoprefixer@10.4.20(postcss@8.4.49): dependencies: browserslist: 4.24.2 - caniuse-lite: 1.0.30001687 + caniuse-lite: 1.0.30001688 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.1.1 @@ -9292,7 +9292,7 @@ snapshots: browserslist@4.24.2: dependencies: - caniuse-lite: 1.0.30001687 + caniuse-lite: 1.0.30001688 electron-to-chromium: 1.5.73 node-releases: 2.0.19 update-browserslist-db: 1.1.1(browserslist@4.24.2) @@ -9371,7 +9371,7 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001687: {} + caniuse-lite@1.0.30001688: {} capital-case@1.0.4: dependencies: @@ -9630,19 +9630,19 @@ snapshots: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 data-view-byte-length@1.0.1: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 data-view-byte-offset@1.0.0: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-data-view: 1.0.1 + is-data-view: 1.0.2 debug@2.6.9: dependencies: @@ -9832,9 +9832,9 @@ snapshots: internal-slot: 1.0.7 is-array-buffer: 3.0.4 is-callable: 1.2.7 - is-data-view: 1.0.1 + is-data-view: 1.0.2 is-negative-zero: 2.0.3 - is-regex: 1.2.0 + is-regex: 1.2.1 is-shared-array-buffer: 1.0.3 is-string: 1.1.0 is-typed-array: 1.1.13 @@ -9843,7 +9843,7 @@ snapshots: object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.3 - safe-array-concat: 1.1.2 + safe-array-concat: 1.1.3 safe-regex-test: 1.0.3 string.prototype.trim: 1.2.10 string.prototype.trimend: 1.0.9 @@ -9874,8 +9874,8 @@ snapshots: has-proto: 1.2.0 has-symbols: 1.1.0 internal-slot: 1.0.7 - iterator.prototype: 1.1.3 - safe-array-concat: 1.1.2 + iterator.prototype: 1.1.4 + safe-array-concat: 1.1.3 es-module-lexer@1.5.4: {} @@ -11029,8 +11029,10 @@ snapshots: dependencies: hasown: 2.0.2 - is-data-view@1.0.1: + is-data-view@1.0.2: dependencies: + call-bound: 1.0.2 + get-intrinsic: 1.2.6 is-typed-array: 1.1.13 is-date-object@1.0.5: @@ -11101,9 +11103,9 @@ snapshots: dependencies: '@types/estree': 1.0.6 - is-regex@1.2.0: + is-regex@1.2.1: dependencies: - call-bind: 1.0.8 + call-bound: 1.0.2 gopd: 1.2.0 has-tostringtag: 1.0.2 hasown: 2.0.2 @@ -11228,9 +11230,10 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - iterator.prototype@1.1.3: + iterator.prototype@1.1.4: dependencies: - define-properties: 1.2.1 + define-data-property: 1.1.4 + es-object-atoms: 1.0.0 get-intrinsic: 1.2.6 has-symbols: 1.1.0 reflect.getprototypeof: 1.0.8 @@ -12585,7 +12588,7 @@ snapshots: '@next/env': 14.2.15 '@swc/helpers': 0.5.5 busboy: 1.6.0 - caniuse-lite: 1.0.30001687 + caniuse-lite: 1.0.30001688 graceful-fs: 4.2.11 postcss: 8.4.31 react: 19.0.0 @@ -12612,7 +12615,7 @@ snapshots: '@swc/counter': 0.1.3 '@swc/helpers': 0.5.15 busboy: 1.6.0 - caniuse-lite: 1.0.30001687 + caniuse-lite: 1.0.30001688 postcss: 8.4.31 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) @@ -13593,9 +13596,10 @@ snapshots: dependencies: mri: 1.2.0 - safe-array-concat@1.1.2: + safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 + call-bound: 1.0.2 get-intrinsic: 1.2.6 has-symbols: 1.1.0 isarray: 2.0.5 @@ -13608,7 +13612,7 @@ snapshots: dependencies: call-bind: 1.0.8 es-errors: 1.3.0 - is-regex: 1.2.0 + is-regex: 1.2.1 safer-buffer@2.1.2: {} @@ -14745,7 +14749,7 @@ snapshots: is-date-object: 1.0.5 is-finalizationregistry: 1.1.0 is-generator-function: 1.0.10 - is-regex: 1.2.0 + is-regex: 1.2.1 is-weakref: 1.0.2 isarray: 2.0.5 which-boxed-primitive: 1.1.0