Switch to BiomeJS (#306)

This commit is contained in:
Gregory Schier
2025-11-23 08:38:13 -08:00
committed by GitHub
parent 2bac610efe
commit ec3e2e16a9
332 changed files with 3007 additions and 4097 deletions

View File

@@ -19,6 +19,7 @@ export function useKeyValue<T extends object | boolean | number | string | null>
fallback: T;
}) {
const { value, isLoading } = useAtomValue(
// biome-ignore lint/correctness/useExhaustiveDependencies: Only create a new atom when the key changes. Fallback might not be a stable reference, so we don't want to refresh on that.
useMemo(
() =>
selectAtom(
@@ -32,9 +33,6 @@ export function useKeyValue<T extends object | boolean | number | string | null>
},
(a, b) => deepEqual(a, b),
),
// Only create a new atom when the key changes. Fallback might not be a stable reference, so
// we don't want to refresh on that.
// eslint-disable-next-line react-hooks/exhaustive-deps
[buildKeyValueKey(key)],
),
);
@@ -44,6 +42,7 @@ export function useKeyValue<T extends object | boolean | number | string | null>
mutationFn: (value) => setKeyValue<T>({ namespace, key, value }),
});
// biome-ignore lint/correctness/useExhaustiveDependencies: none
const set = useCallback(
async (valueOrUpdate: ((v: T) => T) | T) => {
if (typeof valueOrUpdate === 'function') {
@@ -56,7 +55,6 @@ export function useKeyValue<T extends object | boolean | number | string | null>
await mutateAsync(valueOrUpdate);
}
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[typeof key === 'string' ? key : key.join('::'), namespace, value],
);