This commit is contained in:
Manav Rathi 2024-05-25 09:28:41 +05:30
parent 491f38b120
commit 823f739c32
No known key found for this signature in database

View file

@ -1,11 +1,10 @@
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
import type { Dispatch, SetStateAction } from "react";
import { useEffect, useState } from "react";
export function useLocalState<T>(
key: LS_KEYS,
initialValue?: T,
): [T, Dispatch<SetStateAction<T>>] {
initialValue: T,
): [T, (newValue: T) => void] {
const [value, setValue] = useState<T>(initialValue);
useEffect(() => {