Browse Source

feat(client): replace constructor based DI with inject functions

pull/7175/head
KenTandrian 2 weeks ago
parent
commit
9ec661be35
  1. 16
      apps/client/src/app/services/user/user.service.ts

16
apps/client/src/app/services/user/user.service.ts

@ -3,7 +3,7 @@ import { Filter, User } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { HttpClient } from '@angular/common/http';
import { DestroyRef, Injectable } from '@angular/core';
import { DestroyRef, inject, Injectable } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { MatDialog } from '@angular/material/dialog';
import { ObservableStore } from '@codewithdan/observable-store';
@ -24,13 +24,13 @@ import { UserStoreState } from './user-store.state';
export class UserService extends ObservableStore<UserStoreState> {
private deviceType: string;
public constructor(
private destroyRef: DestroyRef,
private deviceDetectorService: DeviceDetectorService,
private dialog: MatDialog,
private http: HttpClient,
private webAuthnService: WebAuthnService
) {
private readonly destroyRef = inject(DestroyRef);
private readonly deviceDetectorService = inject(DeviceDetectorService);
private readonly dialog = inject(MatDialog);
private readonly http = inject(HttpClient);
private readonly webAuthnService = inject(WebAuthnService);
public constructor() {
super({ trackStateHistory: true });
this.setState({ user: undefined }, UserStoreActions.Initialize);

Loading…
Cancel
Save