diff --git a/docs/functions/index.useRGS.html b/docs/functions/index.useRGS.html index 55fc7e69..cf7838ca 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 2d65069e..aaf7ba9b 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 596df63b..07b05c65 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 2b4686d4..4452e1aa 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 4ad146b2..dc1c22ec 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 1995d25d..16a4dc2b 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 756fc3a2..ea827dbe 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 8836129e..450eada6 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 34b8aa8d..87c0939d 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 6cdc66a7..b59ea098 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 07412973..04f640fb 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 62ffb247..344219e7 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 639a352f..54f6b2d0 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 5167e179..373a368d 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 805b8f52..00d86836 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 0864fa50..006262e7 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 7f2e489e..1842cb93 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 42c43a4e..f16a824d 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 b74574fb..3add631a 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 c085bb50..5867df32 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 bd00adaf..4c9ef4ef 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 46c8f30f..3eb2e2a1 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 f53cc3f2..6864afa4 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/package.json b/package.json index 2e4af432..f8737abc 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "preinstall": "node scripts/update-pm.js" }, "devDependencies": { - "@changesets/cli": "^2.27.6", + "@changesets/cli": "^2.27.7", "@repo/typescript-config": "workspace:*", "@types/node": "^20.14.9", "enquirer": "^2.4.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a34cd717..751e76fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: devDependencies: '@changesets/cli': - specifier: ^2.27.6 - version: 2.27.6 + specifier: ^2.27.7 + version: 2.27.7 '@repo/typescript-config': specifier: workspace:* version: link:packages/config-typescript @@ -613,30 +613,30 @@ packages: '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - '@changesets/apply-release-plan@7.0.3': - resolution: {integrity: sha512-klL6LCdmfbEe9oyfLxnidIf/stFXmrbFO/3gT5LU5pcyoZytzJe4gWpTBx3BPmyNPl16dZ1xrkcW7b98e3tYkA==} + '@changesets/apply-release-plan@7.0.4': + resolution: {integrity: sha512-HLFwhKWayKinWAul0Vj+76jVx1Pc2v55MGPVjZ924Y/ROeSsBMFutv9heHmCUj48lJyRfOTJG5+ar+29FUky/A==} - '@changesets/assemble-release-plan@6.0.2': - resolution: {integrity: sha512-n9/Tdq+ze+iUtjmq0mZO3pEhJTKkku9hUxtUadW30jlN7kONqJG3O6ALeXrmc6gsi/nvoCuKjqEJ68Hk8RbMTQ==} + '@changesets/assemble-release-plan@6.0.3': + resolution: {integrity: sha512-bLNh9/Lgl1VwkjWZTq8JmRqH+hj7/Yzfz0jsQ/zJJ+FTmVqmqPj3szeKOri8O/hEM8JmHW019vh2gTO9iq5Cuw==} '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - '@changesets/cli@2.27.6': - resolution: {integrity: sha512-PB7KS5JkCQ4WSXlnfThn8CXAHVwYxFdZvYTimhi12fls/tzj9iimUhKsYwkrKSbw1AiVlGCZtihj5Wkt6siIjA==} + '@changesets/cli@2.27.7': + resolution: {integrity: sha512-6lr8JltiiXPIjDeYg4iM2MeePP6VN/JkmqBsVA5XRiy01hGS3y629LtSDvKcycj/w/5Eur1rEwby/MjcYS+e2A==} hasBin: true - '@changesets/config@3.0.1': - resolution: {integrity: sha512-nCr8pOemUjvGJ8aUu8TYVjqnUL+++bFOQHBVmtNbLvKzIDkN/uiP/Z4RKmr7NNaiujIURHySDEGFPftR4GbTUA==} + '@changesets/config@3.0.2': + resolution: {integrity: sha512-cdEhS4t8woKCX2M8AotcV2BOWnBp09sqICxKapgLHf9m5KdENpWjyrFNMjkLqGJtUys9U+w93OxWT0czorVDfw==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@2.1.0': - resolution: {integrity: sha512-QOt6pQq9RVXKGHPVvyKimJDYJumx7p4DO5MO9AhRJYgAPgv0emhNqAqqysSVKHBm4sxKlGN4S1zXOIb5yCFuhQ==} + '@changesets/get-dependents-graph@2.1.1': + resolution: {integrity: sha512-LRFjjvigBSzfnPU2n/AhFsuWR5DK++1x47aq6qZ8dzYsPtS/I5mNhIGAS68IAxh1xjO9BTtz55FwefhANZ+FCA==} - '@changesets/get-release-plan@4.0.2': - resolution: {integrity: sha512-rOalz7nMuMV2vyeP7KBeAhqEB7FM2GFPO5RQSoOoUKKH9L6wW3QyPA2K+/rG9kBrWl2HckPVES73/AuwPvbH3w==} + '@changesets/get-release-plan@4.0.3': + resolution: {integrity: sha512-6PLgvOIwTSdJPTtpdcr3sLtGatT+Jr22+cQwEBJBy6wP0rjB4yJ9lv583J9fVpn1bfQlBkDa8JxbS2g/n9lIyA==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} @@ -4726,8 +4726,8 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} - pkg-types@1.1.1: - resolution: {integrity: sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==} + pkg-types@1.1.2: + resolution: {integrity: sha512-VEGf1he2DR5yowYRl0XJhWJq5ktm9gYIsH+y8sNJpHlxch7JPDaufgrsl4vYjd9hMUY8QVjoNncKbow9I7exyA==} plop@4.0.1: resolution: {integrity: sha512-5n8QU93kvL/ObOzBcPAB1siVFtAH1TZM6TntJ3JK5kXT0jIgnQV+j+uaOWWFJlg1cNkzLYm8klgASF65K36q9w==} @@ -6572,10 +6572,10 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@changesets/apply-release-plan@7.0.3': + '@changesets/apply-release-plan@7.0.4': dependencies: '@babel/runtime': 7.24.7 - '@changesets/config': 3.0.1 + '@changesets/config': 3.0.2 '@changesets/get-version-range-type': 0.4.0 '@changesets/git': 3.0.0 '@changesets/should-skip-package': 0.1.0 @@ -6589,11 +6589,11 @@ snapshots: resolve-from: 5.0.0 semver: 7.6.2 - '@changesets/assemble-release-plan@6.0.2': + '@changesets/assemble-release-plan@6.0.3': dependencies: '@babel/runtime': 7.24.7 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.0 + '@changesets/get-dependents-graph': 2.1.1 '@changesets/should-skip-package': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -6603,16 +6603,16 @@ snapshots: dependencies: '@changesets/types': 6.0.0 - '@changesets/cli@2.27.6': + '@changesets/cli@2.27.7': dependencies: '@babel/runtime': 7.24.7 - '@changesets/apply-release-plan': 7.0.3 - '@changesets/assemble-release-plan': 6.0.2 + '@changesets/apply-release-plan': 7.0.4 + '@changesets/assemble-release-plan': 6.0.3 '@changesets/changelog-git': 0.2.0 - '@changesets/config': 3.0.1 + '@changesets/config': 3.0.2 '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.0 - '@changesets/get-release-plan': 4.0.2 + '@changesets/get-dependents-graph': 2.1.1 + '@changesets/get-release-plan': 4.0.3 '@changesets/git': 3.0.0 '@changesets/logger': 0.1.0 '@changesets/pre': 2.0.0 @@ -6638,10 +6638,10 @@ snapshots: spawndamnit: 2.0.0 term-size: 2.2.1 - '@changesets/config@3.0.1': + '@changesets/config@3.0.2': dependencies: '@changesets/errors': 0.2.0 - '@changesets/get-dependents-graph': 2.1.0 + '@changesets/get-dependents-graph': 2.1.1 '@changesets/logger': 0.1.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -6652,7 +6652,7 @@ snapshots: dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@2.1.0': + '@changesets/get-dependents-graph@2.1.1': dependencies: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 @@ -6660,11 +6660,11 @@ snapshots: fs-extra: 7.0.1 semver: 7.6.2 - '@changesets/get-release-plan@4.0.2': + '@changesets/get-release-plan@4.0.3': dependencies: '@babel/runtime': 7.24.7 - '@changesets/assemble-release-plan': 6.0.2 - '@changesets/config': 3.0.1 + '@changesets/assemble-release-plan': 6.0.3 + '@changesets/config': 3.0.2 '@changesets/pre': 2.0.0 '@changesets/read': 0.6.0 '@changesets/types': 6.0.0 @@ -10732,7 +10732,7 @@ snapshots: local-pkg@0.5.0: dependencies: mlly: 1.7.1 - pkg-types: 1.1.1 + pkg-types: 1.1.2 locate-path@5.0.0: dependencies: @@ -11545,7 +11545,7 @@ snapshots: dependencies: acorn: 8.12.0 pathe: 1.1.2 - pkg-types: 1.1.1 + pkg-types: 1.1.2 ufo: 1.5.3 modern-ahocorasick@1.0.1: {} @@ -11997,7 +11997,7 @@ snapshots: dependencies: find-up: 4.1.0 - pkg-types@1.1.1: + pkg-types@1.1.2: dependencies: confbox: 0.1.7 mlly: 1.7.1