All files / app/store store.ts

100% Statements 31/31
100% Branches 5/5
100% Functions 2/2
100% Lines 27/27

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45158x     158x 158x 158x 158x 158x 158x 158x 158x         279x   279x 279x 279x 279x 279x 279x 279x 279x 279x 279x 279x 279x 279x 279x     279x   279x           39x      
import { Injectable } from '@angular/core';
import { makeAutoObservable, observable } from 'mobx';
import { RouterStore } from 'mobx-angular';
import { AccountStore } from './account';
import { EventBus } from './bus';
import { GraphStore } from './graph';
import { LocalStore } from './local';
import { OriginStore } from './origin';
import { SubmitStore } from './submit';
import { VideoStore } from './video';
import { ViewStore } from './view';
 
@Injectable({
  providedIn: 'root'
})
export class Store {
 
  local = new LocalStore();
  eventBus = new EventBus();
  origins = new OriginStore();
  account = new AccountStore(this.origins);
  view = new ViewStore(this.route, this.account);
  video = new VideoStore();
  submit = new SubmitStore(this.route, this.eventBus);
  graph = new GraphStore(this.route);
  theme = 'init-theme';
  hotkey = false;
  offline = false;
  viewportHeight = screen.height;
  helpSteps = 0;
  helpStepIndex = -1;
 
  constructor(
    private route: RouterStore,
  ) {
    makeAutoObservable(this, {
      local: observable.ref,
    });
  }
 
  get darkTheme() {
    return this.theme === 'dark-theme';
  }
}