aboutsummaryrefslogtreecommitdiffstats
path: root/apps/mobile/lib/storage-state.ts
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-03-13 22:37:41 +0000
committerMohamed Bassem <me@mbassem.com>2024-03-14 16:40:45 +0000
commita03f1dc2ac25579df30e8cb59d2703110c3e564d (patch)
tree59315e73cd83dc391660071c70752cf23989b3da /apps/mobile/lib/storage-state.ts
parent04572a8e5081b1e4871e273cde9dbaaa44c52fe0 (diff)
downloadkarakeep-a03f1dc2ac25579df30e8cb59d2703110c3e564d.tar.zst
lint: Lint and format the entire repo with the new configs
Diffstat (limited to 'apps/mobile/lib/storage-state.ts')
-rw-r--r--apps/mobile/lib/storage-state.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/mobile/lib/storage-state.ts b/apps/mobile/lib/storage-state.ts
index 4988f0e0..f45ddfe5 100644
--- a/apps/mobile/lib/storage-state.ts
+++ b/apps/mobile/lib/storage-state.ts
@@ -1,5 +1,5 @@
-import * as SecureStore from "expo-secure-store";
import * as React from "react";
+import * as SecureStore from "expo-secure-store";
type UseStateHook<T> = [[boolean, T | null], (value: T | null) => void];
@@ -8,7 +8,7 @@ function useAsyncState<T>(
): UseStateHook<T> {
return React.useReducer(
(
- state: [boolean, T | null],
+ _state: [boolean, T | null],
action: T | null = null,
): [boolean, T | null] => [false, action],
initialValue,
@@ -34,7 +34,7 @@ export function useStorageState<T>(key: string): UseStateHook<T> {
setState(null);
return null;
}
- setState(JSON.parse(value));
+ setState(JSON.parse(value) as T);
});
}, [key]);