villebro commented on code in PR #38603:
URL: https://github.com/apache/superset/pull/38603#discussion_r2925254995


##########
superset-frontend/src/core/editors/AceEditorProvider.tsx:
##########
@@ -186,6 +190,19 @@ const createAceEditorHandle = (
   resize: () => {
     aceEditorRef.current?.editor?.resize();
   },
+
+  onDidChangeContent: (listener, thisArgs?) => {
+    const editor = aceEditorRef.current?.editor;
+    if (!editor) return new Disposable(() => {});
+    const bound = (thisArgs ? listener.bind(thisArgs) : listener) as (
+      value: string,
+    ) => void;
+    const handler = () => bound(editor.getValue());

Review Comment:
   Is there risk that getting the full editor value could be excessively 
expensive in some editors? I wonder if we should rather pass a handle that 
offers getting the contents when/if needed. For instance, to control load, one 
may want to debounce rather than eagerly reacting to every content change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to