diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index c2b2e629..e1fe18e1 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 6b92d841..97626be1 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 4049a409..959b1628 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 fca34071..79d981bd 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 ceccc36c..52800774 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 afac6700..8629e5a4 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 c94711ac..854634d3 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 f92db2f4..2a1e2f18 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 963063a5..f7556fa7 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 bcd862e0..abf1ac3b 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 248d8dc7..acef6598 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

Type declaration

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

Type Parameters

  • T

Type declaration

  • Optionalinit?: (key: string, value: T | undefined, mutate: Mutate<T>) => void
  • OptionalonChange?: (key: string, value?: T) => void
diff --git a/docs/types/utils.SetStateAction.html b/docs/types/utils.SetStateAction.html index f3fb90f2..8ee4c3de 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

Type declaration

+SetStateAction | React18 Global Store

Type Alias SetStateAction<T>

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

Type Parameters

  • T

Type declaration

diff --git a/docs/types/utils.SetterArgType.html b/docs/types/utils.SetterArgType.html index 9f96f610..73388925 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 f6b70bb9..ff729a09 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 9a835de0..803cea56 100644 --- a/docs/types/utils._internal_.Listener.html +++ b/docs/types/utils._internal_.Listener.html @@ -1 +1 @@ -Listener | React18 Global Store
Listener: () => void

Type declaration

    • (): void
    • Returns void

+Listener | React18 Global Store
Listener: () => void

Type declaration

    • (): void
    • Returns void

diff --git a/docs/types/utils._internal_.Mutate.html b/docs/types/utils._internal_.Mutate.html index 0bbcb3e5..9dbba548 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

Type declaration

    • (value?: T): void
    • Parameters

      • Optionalvalue: T

      Returns void

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

Type Parameters

  • T

Type declaration

    • (value?: T): void
    • Parameters

      • Optionalvalue: T

      Returns void

diff --git a/docs/types/utils._internal_.RGS.html b/docs/types/utils._internal_.RGS.html index f0fa1137..b884a7f0 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

-

Type declaration

+

Type declaration

diff --git a/docs/types/utils._internal_.Subscriber.html b/docs/types/utils._internal_.Subscriber.html index 6c2c8c27..6fd5d310 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

Type declaration

+Subscriber | React18 Global Store
Subscriber: (l: Listener) => () => void

Type declaration

diff --git a/docs/variables/utils.globalRGS.html b/docs/variables/utils.globalRGS.html index e50085ea..87aaf529 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 8feba134..38480384 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2355,20 +2355,20 @@ packages: resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} engines: {node: '>= 0.4'} - array.prototype.flat@1.3.2: - resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + array.prototype.flat@1.3.3: + resolution: {integrity: sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==} engines: {node: '>= 0.4'} - array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} + array.prototype.flatmap@1.3.3: + resolution: {integrity: sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==} engines: {node: '>= 0.4'} array.prototype.tosorted@1.1.4: resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} engines: {node: '>= 0.4'} - arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + arraybuffer.prototype.slice@1.0.4: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} assertion-error@2.0.1: @@ -2518,8 +2518,8 @@ packages: resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} engines: {node: '>= 0.4'} - call-bound@1.0.2: - resolution: {integrity: sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==} + call-bound@1.0.3: + resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==} engines: {node: '>= 0.4'} callsites@3.1.0: @@ -3559,8 +3559,8 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + function.prototype.name@1.1.7: + resolution: {integrity: sha512-2g4x+HqTJKM9zcJqBSpjoRmdcPFtJM60J3xJisTQSXBWka5XqyBN/2tNUgma1mztTXyDuUsEtYe5qcs7xYzYQA==} engines: {node: '>= 0.4'} functions-have-names@1.2.3: @@ -9120,14 +9120,14 @@ snapshots: es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 - array.prototype.flat@1.3.2: + array.prototype.flat@1.3.3: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 es-abstract: 1.23.5 es-shim-unscopables: 1.0.2 - array.prototype.flatmap@1.3.2: + array.prototype.flatmap@1.3.3: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 @@ -9142,7 +9142,7 @@ snapshots: es-errors: 1.3.0 es-shim-unscopables: 1.0.2 - arraybuffer.prototype.slice@1.0.3: + arraybuffer.prototype.slice@1.0.4: dependencies: array-buffer-byte-length: 1.0.1 call-bind: 1.0.8 @@ -9151,7 +9151,6 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.2.6 is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 assertion-error@2.0.1: {} @@ -9356,9 +9355,9 @@ snapshots: get-intrinsic: 1.2.6 set-function-length: 1.2.2 - call-bound@1.0.2: + call-bound@1.0.3: dependencies: - call-bind: 1.0.8 + call-bind-apply-helpers: 1.0.1 get-intrinsic: 1.2.6 callsites@3.1.0: {} @@ -9814,7 +9813,7 @@ snapshots: es-abstract@1.23.5: dependencies: array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 + arraybuffer.prototype.slice: 1.0.4 available-typed-arrays: 1.0.7 call-bind: 1.0.8 data-view-buffer: 1.0.1 @@ -9825,7 +9824,7 @@ snapshots: es-object-atoms: 1.0.0 es-set-tostringtag: 2.0.3 es-to-primitive: 1.3.0 - function.prototype.name: 1.1.6 + function.prototype.name: 1.1.7 get-intrinsic: 1.2.6 get-symbol-description: 1.0.2 globalthis: 1.0.4 @@ -10096,8 +10095,8 @@ snapshots: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 + array.prototype.flat: 1.3.3 + array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 eslint: 9.12.0 @@ -10135,7 +10134,7 @@ snapshots: dependencies: aria-query: 5.3.2 array-includes: 3.1.8 - array.prototype.flatmap: 1.3.2 + array.prototype.flatmap: 1.3.3 ast-types-flow: 0.0.8 axe-core: 4.10.2 axobject-query: 4.1.0 @@ -10189,7 +10188,7 @@ snapshots: dependencies: array-includes: 3.1.8 array.prototype.findlast: 1.2.5 - array.prototype.flatmap: 1.3.2 + array.prototype.flatmap: 1.3.3 array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 es-iterator-helpers: 1.2.0 @@ -10636,12 +10635,13 @@ snapshots: function-bind@1.1.2: {} - function.prototype.name@1.1.6: + function.prototype.name@1.1.7: dependencies: call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.5 functions-have-names: 1.2.3 + hasown: 2.0.2 + is-callable: 1.2.7 functions-have-names@1.2.3: {} @@ -10988,7 +10988,7 @@ snapshots: is-arguments@1.2.0: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 has-tostringtag: 1.0.2 is-array-buffer@3.0.4: @@ -11015,7 +11015,7 @@ snapshots: is-boolean-object@1.2.1: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 has-tostringtag: 1.0.2 is-buffer@2.0.5: {} @@ -11036,13 +11036,13 @@ snapshots: is-data-view@1.0.2: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 get-intrinsic: 1.2.6 is-typed-array: 1.1.13 is-date-object@1.1.0: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 has-tostringtag: 1.0.2 is-decimal@1.0.4: {} @@ -11111,7 +11111,7 @@ snapshots: is-regex@1.2.1: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 gopd: 1.2.0 has-tostringtag: 1.0.2 hasown: 2.0.2 @@ -11139,7 +11139,7 @@ snapshots: is-symbol@1.1.1: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 has-symbols: 1.1.0 safe-regex-test: 1.1.0 @@ -11161,7 +11161,7 @@ snapshots: is-weakref@1.1.0: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 is-weakset@2.0.3: dependencies: @@ -11672,7 +11672,7 @@ snapshots: jsx-ast-utils@3.3.5: dependencies: array-includes: 3.1.8 - array.prototype.flat: 1.3.2 + array.prototype.flat: 1.3.3 object.assign: 4.1.5 object.values: 1.2.0 @@ -13597,7 +13597,7 @@ snapshots: safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 - call-bound: 1.0.2 + call-bound: 1.0.3 get-intrinsic: 1.2.6 has-symbols: 1.1.0 isarray: 2.0.5 @@ -13608,7 +13608,7 @@ snapshots: safe-regex-test@1.1.0: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 es-errors: 1.3.0 is-regex: 1.2.1 @@ -13731,14 +13731,14 @@ snapshots: side-channel-map@1.0.1: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 es-errors: 1.3.0 get-intrinsic: 1.2.6 object-inspect: 1.13.3 side-channel-weakmap@1.0.2: dependencies: - call-bound: 1.0.2 + call-bound: 1.0.3 es-errors: 1.3.0 get-intrinsic: 1.2.6 object-inspect: 1.13.3 @@ -13918,7 +13918,7 @@ snapshots: string.prototype.trim@1.2.10: dependencies: call-bind: 1.0.8 - call-bound: 1.0.2 + call-bound: 1.0.3 define-data-property: 1.1.4 define-properties: 1.2.1 es-abstract: 1.23.5 @@ -13928,7 +13928,7 @@ snapshots: string.prototype.trimend@1.0.9: dependencies: call-bind: 1.0.8 - call-bound: 1.0.2 + call-bound: 1.0.3 define-properties: 1.2.1 es-object-atoms: 1.0.0 @@ -14740,8 +14740,8 @@ snapshots: which-builtin-type@1.2.1: dependencies: - call-bound: 1.0.2 - function.prototype.name: 1.1.6 + call-bound: 1.0.3 + function.prototype.name: 1.1.7 has-tostringtag: 1.0.2 is-async-function: 2.0.0 is-date-object: 1.1.0