( editor: CodeMirrorEditor | null, value?: string, )
| 19 | import { CodeMirrorEditor } from './types'; |
| 20 | |
| 21 | export function useSynchronizeValue( |
| 22 | editor: CodeMirrorEditor | null, |
| 23 | value?: string, |
| 24 | ) { |
| 25 | useEffect(() => { |
| 26 | if (editor && typeof value === 'string' && value !== editor.getValue()) { |
| 27 | editor.setValue(value); |
| 28 | } |
| 29 | }, [editor, value]); |
| 30 | } |
| 31 | |
| 32 | export function useSynchronizeOption<K extends keyof EditorConfiguration>( |
| 33 | editor: CodeMirrorEditor | null, |
no outgoing calls
no test coverage detected