import grouping and sorting with Prettier plugin

This commit is contained in:
Timothy Armes
2023-09-11 09:09:34 +02:00
parent 4984639f23
commit 7111f000e5
43 changed files with 589 additions and 210 deletions
+9 -4
View File
@@ -1,4 +1,4 @@
import { atom, SetStateAction } from "jotai";
import { SetStateAction, atom } from "jotai";
export default function atomWithDebounce<T>(
initialValue: T,
@@ -37,9 +37,14 @@ export default function atomWithDebounce<T>(
onDebounceStart();
const nextTimeoutId = setTimeout(() => {
onDebounceEnd();
}, nextValue === initialValue ? delayOnResetMilliseconds : delayMilliseconds);
const nextTimeoutId = setTimeout(
() => {
onDebounceEnd();
},
nextValue === initialValue
? delayOnResetMilliseconds
: delayMilliseconds,
);
// set previous timeout atom in case it needs to get cleared
set(prevTimeoutAtom, nextTimeoutId);