()
| 8 | import { update, selectEditorInit, selectEdit } from "./EditorSlice"; |
| 9 | |
| 10 | export 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 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected