TLSettings.ts 472 B

1234567891011121314151617181920
  1. /* eslint-disable @typescript-eslint/no-explicit-any */
  2. import { observable, makeObservable, action } from 'mobx'
  3. export interface TLSettingsProps {
  4. mode: 'light' | 'dark'
  5. showGrid: boolean
  6. }
  7. export class TLSettings implements TLSettingsProps {
  8. constructor() {
  9. makeObservable(this)
  10. }
  11. @observable mode: 'dark' | 'light' = 'light'
  12. @observable showGrid = true
  13. @action update(props: Partial<TLSettingsProps>): void {
  14. Object.assign(this, props)
  15. }
  16. }