Skip to content

Commit

Permalink
updated use hook to now allow pulling in the entire object
Browse files Browse the repository at this point in the history
  • Loading branch information
sghsri committed Apr 24, 2024
1 parent 1dd7abc commit b236110
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chrome-extension-toolkit",
"version": "0.0.69",
"version": "0.0.70",
"description": "A template for creating npm packages using TypeScript and VSCode",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/storage/createStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export type Store<T = {}> = {
use<K extends keyof T | null>(
key: K
): [
K extends keyof T ? Serializable<T[K]> : T,
K extends keyof T ? Serializable<T[K]> : Serializable<T>,
(value: K extends keyof T ? Serializable<T[K]> : Partial<Serializable<T>>) => Promise<void>
];

Expand All @@ -100,9 +100,9 @@ export type Store<T = {}> = {
*/
use<K extends keyof T | null>(
key: K,
defaultValue: K extends keyof T ? Serializable<T[K]> : T
defaultValue: K extends keyof T ? Serializable<T[K]> : Serializable<T>
): [
K extends keyof T ? Serializable<T[K]> : T,
K extends keyof T ? Serializable<T[K]> : Serializable<T>,
(value: K extends keyof T ? Serializable<T[K]> : Partial<Serializable<T>>) => Promise<void>
];

Expand Down

1 comment on commit b236110

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines Statements Branches Functions
Coverage: 9%
8.65% (27/312) 13.92% (11/79) 9.09% (7/77)

Please sign in to comment.