refactor: ngrx-store use enum ActionTypes and Action classes everywhere (#919)

This commit is contained in:
Róbert Kiss
2019-02-22 19:00:17 +01:00
committed by László Monda
parent de71f6f88c
commit 7a2c8cb2e4
46 changed files with 1026 additions and 978 deletions

View File

@@ -31,8 +31,7 @@ import {
import { Tab } from './tab';
import { AppState, macroPlaybackSupported } from '../../store';
import { getKeymaps } from '../../store/reducers/user-configuration';
import { AppState, getKeymaps, macroPlaybackSupported } from '../../store';
import { KeyActionRemap } from '../../models/key-action-remap';
import { RemapInfo } from '../../models/remap-info';
@@ -153,7 +152,7 @@ export class PopoverComponent implements OnChanges {
constructor(private store: Store<AppState>,
private cdRef: ChangeDetectorRef) {
this.animationState = 'closed';
this.keymaps$ = store.let(getKeymaps())
this.keymaps$ = store.select(getKeymaps)
.pipe(
combineLatest(this.currentKeymap$),
map(([keymaps, currentKeymap]: [Keymap[], Keymap]) =>

View File

@@ -5,8 +5,7 @@ import { KeyAction, Macro, PlayMacroAction } from 'uhk-common';
import { Tab } from '../tab';
import { AppState } from '../../../../store';
import { getMacros } from '../../../../store/reducers/user-configuration';
import { AppState, getMacros } from '../../../../store';
import { SelectOptionData } from '../../../../models/select-option-data';
@Component({
@@ -26,7 +25,7 @@ export class MacroTabComponent extends Tab implements OnInit, OnChanges, OnDestr
constructor(store: Store<AppState>) {
super();
this.subscription = store.let(getMacros())
this.subscription = store.select(getMacros)
.subscribe((macros: Macro[]) => this.macros = macros);
this.macroOptions = [];
this.selectedMacroIndex = 0;