Files
xrpl-hooks-ide/state/actions/updateEditorSettings.ts
2021-12-13 22:54:57 +02:00

14 lines
362 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);
};