Skip to content

Commit

Permalink
fix: make UiState injectable
Browse files Browse the repository at this point in the history
  • Loading branch information
manekinekko committed Feb 28, 2020
1 parent f31e6d9 commit 17541ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/core/state/ui.state.ts
@@ -1,6 +1,7 @@
import { MatSnackBar } from '@angular/material/snack-bar';
import { Action, Selector, State, StateContext } from '@ngxs/store';
import { iif, patch } from '@ngxs/store/operators';
import { Injectable } from '@angular/core';

export interface LayerCSS {
transform: string;
Expand Down Expand Up @@ -58,6 +59,7 @@ export class CurrentLayer {
export class SettingsEnabled {
static readonly type = '[UiSettings] Enable Settings';
}

export class LayerPosition {
static readonly type = '[UiSettings] Set Layer Position';
public left: number;
Expand All @@ -69,6 +71,7 @@ export class LayerPosition {
this.top = top;
}
}

export class ZoomIn {
static readonly type = '[UiSettings] Zoom In';
constructor(public value: number = 0.1) {}
Expand All @@ -77,10 +80,12 @@ export class ZoomOut {
static readonly type = '[UiSettings] Zoom Out';
constructor(public value: number = 0.1) {}
}

export class ZoomReset {
static readonly type = '[UiSettings] Zoom Reset';
constructor() {}
}

export class Toggle3D {
static readonly type = '[UiSettings] Toggle 3D';
constructor(public value: boolean) {}
Expand Down Expand Up @@ -119,6 +124,7 @@ const DEFAULT_UI_STATE = {
name: 'ui',
defaults: DEFAULT_UI_STATE
})
@Injectable()
export class UiState {
constructor(private snackBar: MatSnackBar) {}

Expand Down

0 comments on commit 17541ac

Please sign in to comment.