INNER CODE UNIT · TypeScript
syncEditors
yoav-lavi/melody · playground/src/editors/index.ts:72
const syncEditors = () => {
try {
window.currentEditorContent = melodyEditor.getValue();
const regex = compiler(melodyEditor.getValue());
regexEditor.setValue(regex);
} catch (error: unknown) {
regexEditor.setValue((error as Error).message);
}
};
syncEditors();
melodyEditor.getModel()?.onDidChangeContent(syncEditors);
};