Skip to content

Commit e2ce620

Browse files
committed
improve type safety
1 parent f134894 commit e2ce620

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/non-nullable-type-assertion-style -- as ! operator is forbidden by eslint*/
22
import { createHook, createSetter, createSubcriber, globalRGS } from "./utils";
33

4-
import type { Selector, SetStateAction, ValueType } from "./utils";
4+
import type { SetStateAction, ValueType } from "./utils";
55

66
export type { SetterArgType, SetStateAction, Plugin } from "./utils";
77

@@ -23,7 +23,7 @@ export type { SetterArgType, SetStateAction, Plugin } from "./utils";
2323
const useRGS = <T>(
2424
key: string,
2525
value?: ValueType<T>,
26-
...fields: Selector[]
26+
...fields: (keyof T)[]
2727
): [T, SetStateAction<T>] => {
2828
/** Initialize the named store when invoked for the first time. */
2929
if (!globalRGS[key])

0 commit comments

Comments
 (0)