MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / Editor

Function Editor

flow-debugger/debugger-ui/src/page/editor/Editor.js:10–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import { update, selectEditorInit, selectEdit } from "./EditorSlice";
9
10export const Editor = () => {
11 const dispatch = useDispatch();
12 const init = useSelector(selectEditorInit);
13 const edit = useSelector(selectEdit);
14 const extensions = useMemo(
15 () => [basicSetup, oneDark, StreamLanguage.define(toml)],
16 []
17 );
18 return (
19 <CodeMirror
20 extensions={extensions}
21 value={init}
22 onUpdate={(v) => {
23 if (v.docChanged && edit) {
24 dispatch(update(v.state.doc.toString()));
25 }
26 }}
27 />
28 );
29};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected