Browse Source
716: Improve margin calc and quantity input r=da-kami a=thomaseizinger Quantity input change now looks like this: ![image](https://user-images.githubusercontent.com/5486389/143510846-77af9b9f-761d-4e29-9e3e-df4e90fdd741.png) Fixes #688. Co-authored-by: Thomas Eizinger <thomas@eizinger.io>debug-collab-settlement
bors[bot]
3 years ago
committed by
GitHub
3 changed files with 74 additions and 73 deletions
@ -0,0 +1,11 @@ |
|||
import { useEffect } from "react"; |
|||
|
|||
// Copied from: https://stackoverflow.com/a/61127960/2489334
|
|||
export default function useDebouncedEffect(effect: () => void, deps: any[] | undefined, delay: number) { |
|||
return useEffect(() => { |
|||
const handler = setTimeout(() => effect(), delay); |
|||
|
|||
return () => clearTimeout(handler); |
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|||
}, [...deps || [], delay]); |
|||
} |
Loading…
Reference in new issue