Skip to content

Commit 1ffd5a2

Browse files
committed
doc: add some comments
1 parent d6be3fe commit 1ffd5a2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/MonacoEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export interface MonacoEditorProps {
9696
onEditorOpenRequest?: (model: monaco.editor.ITextModel, options: IEditorOptions | undefined, source: monaco.editor.ICodeEditor, sideBySide?: boolean) => Promise<monaco.editor.ICodeEditor | null>
9797

9898
/**
99-
* Dispose
99+
* if true, the models created by the component will be disposed when they are no longer displayed in the editor
100+
* if false, the models will be kept and re-used the next time the same uri is provided
100101
*/
101102
disposeModels?: boolean
102103
}

src/hooks.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export function useColorTheme (): IColorTheme {
1010
const disposable = themeService.onDidColorThemeChange(() => {
1111
setTheme(themeService.getColorTheme())
1212
})
13+
// Since useEffect is asynchronous, the theme may have changed between the initialization of state and now
14+
// Let's update the state just in case
1315
setTheme(themeService.getColorTheme())
1416
return () => {
1517
disposable.dispose()

0 commit comments

Comments
 (0)