refactor: event editor color picker (#1400)

* refactor: event editor color picker

* refactor: throttle and debounce function signature
This commit is contained in:
Shobhit Nagpal
2024-12-27 15:27:48 +05:30
committed by GitHub
parent 7f39d035fd
commit 6bbf8ce795
8 changed files with 111 additions and 14 deletions
@@ -12,7 +12,7 @@ import useCustomFields from '../../common/hooks-query/useCustomFields';
import useProjectData from '../../common/hooks-query/useProjectData';
import useRundown from '../../common/hooks-query/useRundown';
import useSettings from '../../common/hooks-query/useSettings';
import { debounce } from '../../common/utils/debounce';
import { throttle } from '../../common/utils/throttle';
import { getDefaultFormat } from '../../common/utils/time';
import { getPropertyValue, isStringBoolean } from '../viewers/common/viewUtils';
@@ -85,7 +85,7 @@ export default function Operator() {
}
}
};
const debouncedHandleScroll = debounce(handleUserScroll, 1000);
const throttledHandleScroll = throttle(handleUserScroll, 1000);
const handleScroll = () => {
if (timeoutId.current) {
@@ -97,7 +97,7 @@ export default function Operator() {
setShowEditPrompt(true);
debouncedHandleScroll();
throttledHandleScroll();
};
const handleEdit = useCallback((event: EditEvent) => {