chore: copia de libs/shared con prefijo Pi y APIs de terceros actualizadas

This commit is contained in:
2026-07-27 21:14:48 +02:00
parent 0758b00d54
commit 771d83c0aa
672 changed files with 47352 additions and 4692 deletions

View File

@@ -0,0 +1,35 @@
// Angular
import { Injectable } from '@angular/core';
// Ngrx
import { Store } from '@ngrx/store';
// Rxjs
import { Observable } from 'rxjs';
// State
import { Browser, Device, Size } from '../entities/device-configs.model';
import * as fromActions from '../state/device-configs.actions';
import * as fromState from '../state/device-configs.reducer';
import * as fromSelectors from '../state/device-configs.selectors';
@Injectable({ providedIn: 'root' })
export class DeviceConfigsFacade {
// Device
readonly device$: Observable<Device> = this.store.select(fromSelectors.getDevice);
readonly size$: Observable<Size> = this.store.select(fromSelectors.getSize);
readonly isSmallDevice$: Observable<boolean> = this.store.select(fromSelectors.getIsSmallDevice);
// Browser
readonly browser$: Observable<Browser> = this.store.select(fromSelectors.getBrowser);
constructor(private store: Store<fromState.DeviceConfigsState>) {}
getBrowser(): void {
this.store.dispatch(fromActions.BrowserActions.getBrowser());
}
setDevice(device: Device): void {
this.store.dispatch(fromActions.DeviceActions.saveDeviceType({ device }));
}
}