Skip to content

Commit a6fbad6

Browse files
committed
🔀 rename to UseDbOptions
1 parent 3f953ae commit a6fbad6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: ‎index.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const dbStorage = new DbStorage({
77
});
88
const syncData = new Map<string, unknown>();
99

10-
export type StorageStateOptions<T> = {
10+
export type UseDbOptions<T> = {
1111
defaultValue?: T | (() => T);
1212
optimistic?: boolean;
1313
};
@@ -22,19 +22,19 @@ export type DbState<T> = [
2222

2323
export default function useDb(
2424
key: string,
25-
options?: StorageStateOptions<undefined>,
25+
options?: UseDbOptions<undefined>,
2626
): DbState<unknown>;
2727
export default function useDb<T>(
2828
key: string,
29-
options?: Omit<StorageStateOptions<T | undefined>, "defaultValue">,
29+
options?: Omit<UseDbOptions<T | undefined>, "defaultValue">,
3030
): DbState<T | undefined>;
3131
export default function useDb<T>(
3232
key: string,
33-
options?: StorageStateOptions<T>,
33+
options?: UseDbOptions<T>,
3434
): DbState<T>;
3535
export default function useDb<T = undefined>(
3636
key: string,
37-
options?: StorageStateOptions<T | undefined>,
37+
options?: UseDbOptions<T | undefined>,
3838
): DbState<T | undefined> {
3939
const [defaultValue] = useState(options?.defaultValue);
4040
return useStorage(key, defaultValue, options?.optimistic ?? true);

0 commit comments

Comments
 (0)