mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 09:51:10 +01:00
Switch to BiomeJS (#306)
This commit is contained in:
@@ -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],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user