From d915f74efd53de56b12c4e95a37c723a198e6819 Mon Sep 17 00:00:00 2001 From: Jits Date: Thu, 1 Aug 2024 14:20:59 +0100 Subject: [PATCH] Rename store instance types This brings it in line with the recommended approach from NgRx Signals. --- app/src/app/login/feature/login-flow.store.spec.ts | 4 ++-- app/src/app/login/feature/login-flow.store.ts | 2 +- app/src/app/shared/auth/data/auth.store.spec.ts | 4 ++-- app/src/app/shared/auth/data/auth.store.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/app/login/feature/login-flow.store.spec.ts b/app/src/app/login/feature/login-flow.store.spec.ts index dcd228f..90cdf40 100644 --- a/app/src/app/login/feature/login-flow.store.spec.ts +++ b/app/src/app/login/feature/login-flow.store.spec.ts @@ -1,7 +1,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { MockBuilder, ngMocks } from 'ng-mocks'; import { LoginService } from '../data/login.service'; -import { LoginFlowStore, LoginFlowStoreInstanceType } from './login-flow.store'; +import { LoginFlowStore } from './login-flow.store'; describe('LoginFlowStore', () => { beforeEach(() => @@ -9,7 +9,7 @@ describe('LoginFlowStore', () => { ); it('should create', () => { - const store = ngMocks.get(LoginFlowStore); + const store = ngMocks.get(LoginFlowStore); expect(store).toBeTruthy(); }); }); diff --git a/app/src/app/login/feature/login-flow.store.ts b/app/src/app/login/feature/login-flow.store.ts index 016d409..3577610 100644 --- a/app/src/app/login/feature/login-flow.store.ts +++ b/app/src/app/login/feature/login-flow.store.ts @@ -52,7 +52,7 @@ const initialState: LoginFlowState = { const logger = createLogger('LoginFlowStore'); -export type LoginFlowStoreInstanceType = InstanceType; +export type LoginFlowStore = InstanceType; export const LoginFlowStore = signalStore( withState(initialState), diff --git a/app/src/app/shared/auth/data/auth.store.spec.ts b/app/src/app/shared/auth/data/auth.store.spec.ts index 5d18ebd..044d70b 100644 --- a/app/src/app/shared/auth/data/auth.store.spec.ts +++ b/app/src/app/shared/auth/data/auth.store.spec.ts @@ -1,7 +1,7 @@ import { MockBuilder, MockInstance, ngMocks } from 'ng-mocks'; import { of } from 'rxjs'; import { AuthService } from './auth.service'; -import { AuthStore, AuthStoreInstanceType } from './auth.store'; +import { AuthStore } from './auth.store'; describe('AuthStore', () => { MockInstance.scope(); @@ -11,7 +11,7 @@ describe('AuthStore', () => { it('should create', () => { MockInstance(AuthService, 'user$', of(null)); - const store = ngMocks.get(AuthStore); + const store = ngMocks.get(AuthStore); expect(store).toBeTruthy(); }); }); diff --git a/app/src/app/shared/auth/data/auth.store.ts b/app/src/app/shared/auth/data/auth.store.ts index 3c1adf7..8a5c71f 100644 --- a/app/src/app/shared/auth/data/auth.store.ts +++ b/app/src/app/shared/auth/data/auth.store.ts @@ -51,7 +51,7 @@ const initialState: AuthState = { const logger = createLogger('AuthStore'); -export type AuthStoreInstanceType = InstanceType; +export type AuthStore = InstanceType; export const AuthStore = signalStore( { providedIn: 'root' }, @@ -126,7 +126,7 @@ export const AuthStore = signalStore( }), ); -function helpersFactory(store: AuthStoreInstanceType) { +function helpersFactory(store: AuthStore) { const waitUntilConnected$ = toObservable(store.status).pipe( tap((status) => logger.log('waitUntilConnected$ - status =', status)), filter((status) => status === 'connected'),