Skip to content

Commit 5d55a38

Browse files
committed
Update examples
1 parent 7c910d4 commit 5d55a38

File tree

13 files changed

+22
-148
lines changed

13 files changed

+22
-148
lines changed

lib/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type { SetterArgType, SetStateAction, Plugin } from "./utils";
2323
const useRGS = <T>(
2424
key: string,
2525
value?: ValueType<T>,
26-
includeRegExp?: RegExp | null,
26+
includeRegExp?: RegExp | null | 0,
2727
excludeRegExp?: RegExp,
2828
): [T, SetStateAction<T>] => {
2929
/** Initialize the named store when invoked for the first time. */

lib/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const triggerListeners = <T>(rgs: RGS, oldV: T, newV: T) => {
4848
/** Extract coomon create hook logic to utils */
4949
export const createHook = <T>(
5050
key: string,
51-
includeRegExp?: RegExp | null,
51+
includeRegExp?: RegExp | null | 0,
5252
excludeRegExp?: RegExp,
5353
): [T, SetStateAction<T>] => {
5454
const rgs = globalRGS[key] as RGS;
@@ -149,7 +149,7 @@ export const useRGSWithPlugins = <T>(
149149
value?: ValueType<T>,
150150
plugins?: Plugin<T>[],
151151
doNotInit = false,
152-
includeRegExp?: RegExp | null,
152+
includeRegExp?: RegExp | null | 0,
153153
excludeRegExp?: RegExp,
154154
): [T, SetStateAction<T>] => {
155155
if (!globalRGS[key]?.s) initWithPlugins(key, value, plugins, doNotInit);

lib/tests/with-selectors/counter-without-selectors.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

lib/tests/with-selectors/counter.tsx

Lines changed: 0 additions & 22 deletions
This file was deleted.

lib/tests/with-selectors/header.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

lib/tests/with-selectors/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/tests/with-selectors/store.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/tests/with-selectors/user-data.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

lib/tests/with-selectors/with-selectors.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/shared/src/client/demo/with-selectors/counter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useRef } from "react";
22
import { useStore } from "./store";
33

44
export function Counter() {
5-
const [{ count }, setState] = useStore("count");
5+
const [{ count }, setState] = useStore(/^count$/);
66
const renderCount = useRef(0);
77
renderCount.current++;
88
return (

0 commit comments

Comments
 (0)