diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index 37827ede..9c8d3831 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 da6497bf..795337ea 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 ae24e5b9..9b068b25 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 e1724f4e..7cffcf63 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 c65d444d..b9ac1e66 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 f8b1ec5c..5c31ab4f 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 3d9bdd85..70dd872b 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 158334a9..9128cf66 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 e57930c8..c32eab93 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 49a190ee..f07adb6c 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 eb19cf93..07f1fe34 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 aae922f8..0cc67948 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 b66056c0..9d89f293 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 f992916d..355ad0e4 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 0c13f61a..a5793bcf 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 9108b151..71045f7f 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 88516543..a34a057a 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 84e77499..7ea7d972 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 d32d7fa9..74dca3c1 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 333354ea..640c153f 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 dfd133be..e3011acc 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 8267d461..bff98dc3 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 691f6558..90d85942 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 cb21f5c0..65389c33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1082,10 +1082,6 @@ packages: '@jspm/core@2.0.1': resolution: {integrity: sha512-Lg3PnLp0QXpxwLIAuuJboLeRaIhrgJjeuh797QADg3xz8wGLugQOS5DpsE8A6i6Adgzf+bacllkKZG3J0tGfDw==} - '@ljharb/through@2.3.13': - resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==} - engines: {node: '>= 0.4'} - '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -3297,8 +3293,8 @@ packages: inline-style-parser@0.1.1: resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} - inquirer@9.2.23: - resolution: {integrity: sha512-kod5s+FBPIDM2xiy9fu+6wdU/SkK5le5GS9lh4FEBjBHqiMgD9lLFbCbuqFNAjNL2ZOy9Wd9F694IOzN9pZHBA==} + inquirer@9.3.0: + resolution: {integrity: sha512-zdopqPUKWmnOcaBJYMMtjqWCB2HHXrteAou9tCYgkTJu01QheLfYOrkzigDfidPBtCizmkdpSU0fp2DKaMdFPA==} engines: {node: '>=18'} internal-slot@1.0.7: @@ -3907,6 +3903,9 @@ packages: lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + lodash.set@4.3.2: + resolution: {integrity: sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==} + lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} @@ -7132,10 +7131,6 @@ snapshots: '@jspm/core@2.0.1': {} - '@ljharb/through@2.3.13': - dependencies: - call-bind: 1.0.7 - '@manypkg/find-root@1.1.0': dependencies: '@babel/runtime': 7.24.7 @@ -9951,18 +9946,17 @@ snapshots: inline-style-parser@0.1.1: {} - inquirer@9.2.23: + inquirer@9.3.0: dependencies: '@inquirer/figures': 1.0.3 - '@ljharb/through': 2.3.13 ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 cli-width: 4.1.0 external-editor: 3.1.0 - lodash: 4.17.21 + lodash.get: 4.4.2 + lodash.set: 4.3.2 mute-stream: 1.0.0 ora: 5.4.1 + picocolors: 1.0.1 run-async: 3.0.0 rxjs: 7.8.1 string-width: 4.2.3 @@ -10757,6 +10751,8 @@ snapshots: lodash.merge@4.6.2: {} + lodash.set@4.3.2: {} + lodash.sortby@4.7.0: {} lodash.startcase@4.4.0: {} @@ -11650,7 +11646,7 @@ snapshots: del: 7.1.0 globby: 13.2.2 handlebars: 4.7.8 - inquirer: 9.2.23 + inquirer: 9.3.0 isbinaryfile: 5.0.2 lodash.get: 4.4.2 lower-case: 2.0.2