fix: resuelve invarianza de inputs heredados y estrictez de tipos heredada
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Angular
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
|
||||
// Ngrx
|
||||
import { Store } from '@ngrx/store';
|
||||
@@ -15,6 +15,10 @@ import * as fromSelectors from '../state/device-configs.selectors';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DeviceConfigsFacade {
|
||||
// `inject()` en vez de parámetro de constructor: los inicializadores de
|
||||
// propiedad de abajo se evalúan antes que los parámetros del constructor.
|
||||
private readonly store = inject<Store<fromState.DeviceConfigsState>>(Store);
|
||||
|
||||
// Device
|
||||
readonly device$: Observable<Device> = this.store.select(fromSelectors.getDevice);
|
||||
readonly size$: Observable<Size> = this.store.select(fromSelectors.getSize);
|
||||
@@ -23,8 +27,6 @@ export class DeviceConfigsFacade {
|
||||
// Browser
|
||||
readonly browser$: Observable<Browser> = this.store.select(fromSelectors.getBrowser);
|
||||
|
||||
constructor(private store: Store<fromState.DeviceConfigsState>) {}
|
||||
|
||||
getBrowser(): void {
|
||||
this.store.dispatch(fromActions.BrowserActions.getBrowser());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user