diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index ba6abcb9..de42af28 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 fa1863ea..2367f32c 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 916fbc2e..f35a475b 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 0553b509..bb960728 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 9bcddedc..07d762a7 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 f400b5a1..53946df4 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 4f806aed..45ce6439 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 3f76049a..e3622570 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 a106f88a..9f06064d 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.

    -
+
diff --git a/docs/interfaces/plugins_persist.PersistOptions.html b/docs/interfaces/plugins_persist.PersistOptions.html index a40e20df..ea7dcc5f 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/modules/index.html b/docs/modules/index.html index 22d5d9c1..d2d84e75 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

Functions

useRGS diff --git a/docs/modules/plugins_persist.html b/docs/modules/plugins_persist.html index 1a2bd769..1c8d3ce5 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

diff --git a/docs/modules/utils.html b/docs/modules/utils.html index 8aa85c2b..0e8e2d42 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 7ad46611..e465eeb3 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
diff --git a/docs/types/utils.Plugin.html b/docs/types/utils.Plugin.html index 12eb5eb2..17725cc5 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
+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
diff --git a/docs/types/utils.SetStateAction.html b/docs/types/utils.SetStateAction.html index 57129c89..be461e69 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
+SetStateAction | React18 Global Store

Type Alias SetStateAction<T>

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

Type Parameters

  • T
diff --git a/docs/types/utils.SetterArgType.html b/docs/types/utils.SetterArgType.html index a037bad6..836f56a9 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
+SetterArgType | React18 Global Store

Type Alias SetterArgType<T>

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

Type Parameters

  • T
diff --git a/docs/types/utils.ValueType.html b/docs/types/utils.ValueType.html index b3a19009..5291b161 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
+ValueType | React18 Global Store

Type Alias ValueType<T>

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

Type Parameters

  • T
diff --git a/docs/types/utils._internal_.Listener.html b/docs/types/utils._internal_.Listener.html index 454802c2..e429dd34 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 7873fbf1..3e019238 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
+Mutate | React18 Global Store
Mutate<T>: ((value?: T) => void)

Type Parameters

  • T
diff --git a/docs/types/utils._internal_.RGS.html b/docs/types/utils._internal_.RGS.html index 42ec163c..0285f0bc 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 23b6f456..45b0fc2c 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 3fe2a367..20df7e80 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 70cc332b..ac6d5e82 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4910,8 +4910,8 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} - pkg-types@1.1.3: - resolution: {integrity: sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==} + pkg-types@1.2.0: + resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} plop@4.0.1: resolution: {integrity: sha512-5n8QU93kvL/ObOzBcPAB1siVFtAH1TZM6TntJ3JK5kXT0jIgnQV+j+uaOWWFJlg1cNkzLYm8klgASF65K36q9w==} @@ -11089,7 +11089,7 @@ snapshots: local-pkg@0.5.0: dependencies: mlly: 1.7.1 - pkg-types: 1.1.3 + pkg-types: 1.2.0 locate-path@5.0.0: dependencies: @@ -11904,7 +11904,7 @@ snapshots: dependencies: acorn: 8.12.1 pathe: 1.1.2 - pkg-types: 1.1.3 + pkg-types: 1.2.0 ufo: 1.5.4 modern-ahocorasick@1.0.1: {} @@ -12366,7 +12366,7 @@ snapshots: dependencies: find-up: 4.1.0 - pkg-types@1.1.3: + pkg-types@1.2.0: dependencies: confbox: 0.1.7 mlly: 1.7.1