fixes useThrottledEffect

This commit is contained in:
James
2020-07-29 21:19:28 -04:00
parent 16b9aab785
commit 0cc468ad6a

View File

@@ -1,3 +1,4 @@
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect, useRef } from 'react';
const useThrottledEffect = (callback, delay, deps = []) => {
@@ -16,8 +17,7 @@ const useThrottledEffect = (callback, delay, deps = []) => {
clearTimeout(handler);
};
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[delay, ...deps, callback],
[delay, ...deps],
);
};