Files
xrpl-hooks-ide/state/actions/updateEditorSettings.ts
2022-08-17 11:50:49 +05:30

13 lines
351 B
TypeScript

import state, { IState } from '../index'
// Updates editor settings and stores them
// in global state
export const updateEditorSettings = (editorSettings: IState['editorSettings']) => {
state.editorCtx?.getModels().forEach(model => {
model.updateOptions({
...editorSettings
})
})
return (state.editorSettings = editorSettings)
}