Skip to content

Commit a8310fa

Browse files
committed
⚡️(frontend) remove debounce on useHeadings
We remove the debounce on useHeadings, it decreases the user experience and it's not necessary a big performance improvement.
1 parent a902e31 commit a8310fa

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/frontend/apps/impress/src/features/docs/doc-editor/hook/useHeadings.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ export const useHeadings = (editor: BlockNoteEditor) => {
99
useEffect(() => {
1010
setHeadings(editor);
1111

12-
let timeout: NodeJS.Timeout;
1312
editor?.onEditorContentChange(() => {
14-
clearTimeout(timeout);
15-
timeout = setTimeout(() => setHeadings(editor), 200);
13+
setHeadings(editor);
1614
});
1715

1816
return () => {
19-
clearTimeout(timeout);
2017
resetHeadings();
2118
};
2219
}, [editor, resetHeadings, setHeadings]);

0 commit comments

Comments
 (0)