diff --git a/docs/functions/index.index.html b/docs/functions/index.index.html index 1cb935f7..d0053d87 100644 --- a/docs/functions/index.index.html +++ b/docs/functions/index.index.html @@ -9,4 +9,4 @@

Example

const [state, setState] = useRGS<number>("counter", 1);
 
-
\ 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 3075460e..90b671dd 100644 --- a/docs/functions/plugins_persist.persist.html +++ b/docs/functions/plugins_persist.persist.html @@ -1,3 +1,3 @@ persist | React18 Global Store
\ 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 1a9b18ba..bab931cf 100644 --- a/docs/functions/utils.createHook.html +++ b/docs/functions/utils.createHook.html @@ -1,2 +1,2 @@ createHook | React18 Global Store
\ No newline at end of file +

Type Parameters

Parameters

Returns [T, SetStateAction<T>]

\ No newline at end of file diff --git a/docs/functions/utils.createSetter.html b/docs/functions/utils.createSetter.html index b467d050..c01d8397 100644 --- a/docs/functions/utils.createSetter.html +++ b/docs/functions/utils.createSetter.html @@ -1,2 +1,2 @@ createSetter | React18 Global Store
\ No newline at end of file +

Type Parameters

Parameters

Returns SetStateAction<unknown>

\ No newline at end of file diff --git a/docs/functions/utils.createSubcriber.html b/docs/functions/utils.createSubcriber.html index 65c3944b..bb25b5c4 100644 --- a/docs/functions/utils.createSubcriber.html +++ b/docs/functions/utils.createSubcriber.html @@ -1,2 +1,2 @@ createSubcriber | React18 Global Store
\ No newline at end of file +

Parameters

Returns Subscriber

\ No newline at end of file diff --git a/docs/functions/utils.initWithPlugins.html b/docs/functions/utils.initWithPlugins.html index 39a37ea0..6c270a27 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
    • Optional value: ValueType<T>
    • plugins: Plugin<T>[] = []
    • doNotInit: boolean = false

    Returns void

\ No newline at end of file +

Type Parameters

Parameters

Returns void

\ No newline at end of file diff --git a/docs/functions/utils.useRGSWithPlugins.html b/docs/functions/utils.useRGSWithPlugins.html index a31e1c71..94e48cba 100644 --- a/docs/functions/utils.useRGSWithPlugins.html +++ b/docs/functions/utils.useRGSWithPlugins.html @@ -11,4 +11,4 @@

Example

const [state, setState] = useRGS<number>("counter", 1);
 
-
\ 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 5ec5a522..39270326 100644 --- a/docs/functions/with_plugins.create.html +++ b/docs/functions/with_plugins.create.html @@ -7,4 +7,4 @@

Example

// in hook file, e.g., store.ts
export const useMyRGS = create<type>(key, value, plugins);

// in component file
const [state, setState] = useMyRGS();
-
\ 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 69b97bd7..4878e349 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, value?, doNotInit?) => [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 2b159399..4395c940 100644 --- a/docs/interfaces/plugins_persist.PersistOptions.html +++ b/docs/interfaces/plugins_persist.PersistOptions.html @@ -1,7 +1,7 @@ -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"

Default Value

local
 
-
sync?: boolean

Default Value

true
+
sync?: boolean

Default Value

true
 
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/modules/Guides.html b/docs/modules/Guides.html index 2713c079..5ebe5f18 100644 --- a/docs/modules/Guides.html +++ b/docs/modules/Guides.html @@ -1,3 +1,3 @@ -Guides | React18 Global Store

Index

Variables

A_Quick_Start +Guides | React18 Global Store
\ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index 7a97f2bf..a9afbdbc 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

index diff --git a/docs/modules/plugins.html b/docs/modules/plugins.html index fba51367..1323b11e 100644 --- a/docs/modules/plugins.html +++ b/docs/modules/plugins.html @@ -1,3 +1,3 @@ -plugins | React18 Global Store

References

PersistOptions +plugins | React18 Global Store

References

Re-exports PersistOptions
Re-exports persist
\ No newline at end of file diff --git a/docs/modules/plugins_persist.html b/docs/modules/plugins_persist.html index 48beefac..bf17356d 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
\ No newline at end of file diff --git a/docs/modules/utils.html b/docs/modules/utils.html index 3e5b066f..65426f1e 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 9dcdab3d..b2c95d3c 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 51f0e26a..382c1451 100644 --- a/docs/types/utils.Plugin.html +++ b/docs/types/utils.Plugin.html @@ -1 +1 @@ -Plugin | React18 Global Store
Plugin<T>: {
    init?: ((key, value, mutate) => void);
    onChange?: ((key, value?) => void);
}

Type Parameters

  • T

Type declaration

  • Optional init?: ((key, value, mutate) => void)
      • (key, value, mutate): void
      • Parameters

        • key: string
        • value: T | undefined
        • mutate: Mutate<T>

        Returns void

  • Optional onChange?: ((key, value?) => void)
      • (key, value?): void
      • Parameters

        • key: string
        • Optional value: T

        Returns void

\ No newline at end of file +Plugin | React18 Global Store
Plugin<T>: {
    init?: ((key, value, mutate) => void);
    onChange?: ((key, value?) => void);
}

Type Parameters

  • T

Type declaration

  • Optional init?: ((key, value, mutate) => void)
      • (key, value, mutate): void
      • Parameters

        • key: string
        • value: T | undefined
        • mutate: Mutate<T>

        Returns void

  • Optional onChange?: ((key, value?) => void)
      • (key, value?): void
      • Parameters

        • key: string
        • Optional value: T

        Returns void

\ No newline at end of file diff --git a/docs/types/utils.SetStateAction.html b/docs/types/utils.SetStateAction.html index 3ba23f05..2316b84c 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) => void)

Type Parameters

  • T

Type declaration

\ No newline at end of file +SetStateAction | React18 Global Store

Type alias SetStateAction<T>

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

Type Parameters

  • T

Type declaration

\ No newline at end of file diff --git a/docs/types/utils.SetterArgType.html b/docs/types/utils.SetterArgType.html index 0dd93707..71d660b3 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)

Type Parameters

  • T

Type declaration

    • (prevState): T
    • Parameters

      • prevState: T

      Returns T

\ No newline at end of file +SetterArgType | React18 Global Store

Type alias SetterArgType<T>

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

Type Parameters

  • T

Type declaration

    • (prevState): T
    • Parameters

      • prevState: T

      Returns T

\ No newline at end of file diff --git a/docs/types/utils.ValueType.html b/docs/types/utils.ValueType.html index f993079d..6ba2b2cc 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

Type declaration

    • (): T
    • Returns T

\ No newline at end of file +ValueType | React18 Global Store

Type alias ValueType<T>

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

Type Parameters

  • T

Type declaration

    • (): T
    • Returns T

\ No newline at end of file diff --git a/docs/types/utils._internal_.Listener.html b/docs/types/utils._internal_.Listener.html index bebbfa02..a9cf6af2 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

\ No newline at end of file +Listener | React18 Global Store
Listener: (() => void)

Type declaration

    • (): void
    • Returns void

\ No newline at end of file diff --git a/docs/types/utils._internal_.Mutate.html b/docs/types/utils._internal_.Mutate.html index 74ae4486..d4ed74bf 100644 --- a/docs/types/utils._internal_.Mutate.html +++ b/docs/types/utils._internal_.Mutate.html @@ -1 +1 @@ -Mutate | React18 Global Store
Mutate<T>: ((value?) => void)

Type Parameters

  • T

Type declaration

    • (value?): void
    • Parameters

      • Optional value: T

      Returns void

\ No newline at end of file +Mutate | React18 Global Store
Mutate<T>: ((value?) => void)

Type Parameters

  • T

Type declaration

    • (value?): void
    • Parameters

      • Optional value: T

      Returns void

\ No newline at end of file diff --git a/docs/types/utils._internal_.RGS.html b/docs/types/utils._internal_.RGS.html index 34ba5605..a7c3c544 100644 --- a/docs/types/utils._internal_.RGS.html +++ b/docs/types/utils._internal_.RGS.html @@ -1 +1 @@ -RGS | React18 Global Store
\ No newline at end of file +RGS | React18 Global Store
\ No newline at end of file diff --git a/docs/types/utils._internal_.Subscriber.html b/docs/types/utils._internal_.Subscriber.html index ce77851d..c44ba8d6 100644 --- a/docs/types/utils._internal_.Subscriber.html +++ b/docs/types/utils._internal_.Subscriber.html @@ -1 +1 @@ -Subscriber | React18 Global Store
Subscriber: ((l) => (() => void))

Type declaration

    • (l): (() => void)
    • Parameters

      Returns (() => void)

        • (): void
        • Returns void

\ No newline at end of file +Subscriber | React18 Global Store
Subscriber: ((l) => (() => void))

Type declaration

    • (l): (() => void)
    • Parameters

      Returns (() => void)

        • (): void
        • Returns void

\ No newline at end of file diff --git a/docs/variables/Guides.A_Quick_Start.html b/docs/variables/Guides.A_Quick_Start.html index d9b391e1..2a758477 100644 --- a/docs/variables/Guides.A_Quick_Start.html +++ b/docs/variables/Guides.A_Quick_Start.html @@ -21,4 +21,4 @@
// components/counter.tsx
"use client";

import useRGS from "r18gs";
import { COUNTER } from "../constants/global-states";

export default function Counter() {
const [count, setCount] = useRGS(COUNTER, 0);
return (
<div>
<h2>Client Component 1</h2>
<input
onChange={e => {
setCount(parseInt(e.target.value.trim()));
}}
type="number"
value={count}
/>
</div>
);
}
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/variables/Guides.B_Leveraging_Plugins.html b/docs/variables/Guides.B_Leveraging_Plugins.html index fade1949..4b93706e 100644 --- a/docs/variables/Guides.B_Leveraging_Plugins.html +++ b/docs/variables/Guides.B_Leveraging_Plugins.html @@ -18,4 +18,4 @@
export function MyComponent(props: MyComponentProps) {
const [state, setState] = useMyRGS(props.key, props.initialVal, props.doNotInit);
// ...
}

You can also create your own plugins. Refer to Creating Plugins.

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/variables/utils.globalRGS.html b/docs/variables/utils.globalRGS.html index 290534a1..7c528cf7 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