ソースを参照

change throttle time

reiji-h 2 年 前
コミット
63a9c966ed
1 ファイル変更2 行追加2 行削除
  1. 2 2
      apps/app/src/components/PageEditor/PageEditor.tsx

+ 2 - 2
apps/app/src/components/PageEditor/PageEditor.tsx

@@ -457,7 +457,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
     }
   }, [codeMirrorEditor, previewRef]);
 
-  const scrollEditorHandlerThrottle = useMemo(() => throttle(20, scrollEditorHandler), [scrollEditorHandler]);
+  const scrollEditorHandlerThrottle = useMemo(() => throttle(150, scrollEditorHandler), [scrollEditorHandler]);
 
   const scrollPreviewHandler = useCallback(() => {
     console.log('ScrollPreview!');
@@ -466,7 +466,7 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
     }
   }, [codeMirrorEditor, previewRef]);
 
-  const scrollPreviewHandlerThrottle = useMemo(() => throttle(20, scrollPreviewHandler), [scrollPreviewHandler]);
+  const scrollPreviewHandlerThrottle = useMemo(() => throttle(150, scrollPreviewHandler), [scrollPreviewHandler]);
 
   const afterResolvedHandler = useCallback(async() => {
     // get page data from db