From d7cffbe7c5f732976dfa351070a1019aae38025c Mon Sep 17 00:00:00 2001 From: Silke Date: Mon, 8 Aug 2022 09:21:25 +0200 Subject: [PATCH] style: use finnish notation for observables --- src/app/core/authorization-toggle.module.ts | 6 +++--- src/app/core/directives/product-context.directive.ts | 6 +++--- src/app/core/feature-toggle.module.ts | 8 ++++---- src/app/core/role-toggle.module.ts | 6 +++--- .../content-include/content-include.component.ts | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/core/authorization-toggle.module.ts b/src/app/core/authorization-toggle.module.ts index b2a5fa90ab..c165d59a49 100644 --- a/src/app/core/authorization-toggle.module.ts +++ b/src/app/core/authorization-toggle.module.ts @@ -11,7 +11,7 @@ import { whenTruthy } from './utils/operators'; exports: [AuthorizationToggleDirective], }) export class AuthorizationToggleModule { - private static permissions = new ReplaySubject(1); + private static permissions$ = new ReplaySubject(1); static forTesting(...permissions: string[]): ModuleWithProviders { AuthorizationToggleModule.switchTestingPermissions(...permissions); @@ -22,7 +22,7 @@ export class AuthorizationToggleModule { provide: AuthorizationToggleService, useValue: { isAuthorizedTo: (permission: string) => - AuthorizationToggleModule.permissions.pipe( + AuthorizationToggleModule.permissions$.pipe( whenTruthy(), map(perms => checkPermission(perms, permission)) ), @@ -33,7 +33,7 @@ export class AuthorizationToggleModule { } static switchTestingPermissions(...permissions: string[]) { - AuthorizationToggleModule.permissions.next(permissions); + AuthorizationToggleModule.permissions$.next(permissions); } } diff --git a/src/app/core/directives/product-context.directive.ts b/src/app/core/directives/product-context.directive.ts index 0e224e06ec..7cfe4eb492 100644 --- a/src/app/core/directives/product-context.directive.ts +++ b/src/app/core/directives/product-context.directive.ts @@ -20,7 +20,7 @@ export class ProductContextDirective implements OnInit { @Output() skuChange = this.context.select('sku'); @Output() quantityChange = this.context.select('quantity'); - private propIndex = new ReplaySubject(1); + private propIndex$ = new ReplaySubject(1); constructor(@SkipSelf() @Optional() parentContext: ProductContextFacade, private context: ProductContextFacade) { if (parentContext) { @@ -39,7 +39,7 @@ export class ProductContextDirective implements OnInit { parentContext.connect( 'children', combineLatest([ - this.propIndex.pipe(startWith(undefined), distinctUntilChanged(), pairwise()), + this.propIndex$.pipe(startWith(undefined), distinctUntilChanged(), pairwise()), this.context.select().pipe(debounceTime(0)), ]), (parent, [[prevId, currId], context]) => { @@ -99,7 +99,7 @@ export class ProductContextDirective implements OnInit { @Input() set propagateIndex(index: number | string) { - this.propIndex.next(index); + this.propIndex$.next(index); } @Input() diff --git a/src/app/core/feature-toggle.module.ts b/src/app/core/feature-toggle.module.ts index ec7485d3a3..e9b5ee89fd 100644 --- a/src/app/core/feature-toggle.module.ts +++ b/src/app/core/feature-toggle.module.ts @@ -11,7 +11,7 @@ import { FeatureToggleService, checkFeature } from './utils/feature-toggle/featu exports: [FeatureToggleDirective, NotFeatureToggleDirective], }) export class FeatureToggleModule { - private static features = new BehaviorSubject(undefined); + private static features$ = new BehaviorSubject(undefined); static forTesting(...features: string[]): ModuleWithProviders { FeatureToggleModule.switchTestingFeatures(...features); @@ -22,9 +22,9 @@ export class FeatureToggleModule { provide: FeatureToggleService, useValue: { enabled$: (feature: string) => - FeatureToggleModule.features.pipe(map(toggles => checkFeature(toggles, feature))), + FeatureToggleModule.features$.pipe(map(toggles => checkFeature(toggles, feature))), // eslint-disable-next-line rxjs/no-subject-value - enabled: (feature: string) => checkFeature(FeatureToggleModule.features.value, feature), + enabled: (feature: string) => checkFeature(FeatureToggleModule.features$.value, feature), }, }, ], @@ -32,7 +32,7 @@ export class FeatureToggleModule { } static switchTestingFeatures(...features: string[]) { - FeatureToggleModule.features.next(features); + FeatureToggleModule.features$.next(features); } } diff --git a/src/app/core/role-toggle.module.ts b/src/app/core/role-toggle.module.ts index bca639a8b4..ca7c3e3fb4 100644 --- a/src/app/core/role-toggle.module.ts +++ b/src/app/core/role-toggle.module.ts @@ -11,7 +11,7 @@ import { RoleToggleService, checkRole } from './utils/role-toggle/role-toggle.se exports: [NotRoleToggleDirective], }) export class RoleToggleModule { - private static roleIds = new ReplaySubject(1); + private static roleIds$ = new ReplaySubject(1); static forTesting(...roleIds: string[]): ModuleWithProviders { RoleToggleModule.switchTestingRoles(...roleIds); @@ -22,7 +22,7 @@ export class RoleToggleModule { provide: RoleToggleService, useValue: { hasRole: (roleId: string | string[]) => - RoleToggleModule.roleIds.pipe( + RoleToggleModule.roleIds$.pipe( whenTruthy(), map(roles => checkRole(roles, roleId)) ), @@ -33,7 +33,7 @@ export class RoleToggleModule { } static switchTestingRoles(...roleIds: string[]) { - RoleToggleModule.roleIds.next(roleIds); + RoleToggleModule.roleIds$.next(roleIds); } } diff --git a/src/app/shared/cms/components/content-include/content-include.component.ts b/src/app/shared/cms/components/content-include/content-include.component.ts index 16a446f4da..66ab7d8930 100644 --- a/src/app/shared/cms/components/content-include/content-include.component.ts +++ b/src/app/shared/cms/components/content-include/content-include.component.ts @@ -25,15 +25,15 @@ export class ContentIncludeComponent implements OnInit, OnChanges { contentInclude$: Observable; - private includeIdChange = new ReplaySubject(1); + private includeIdChange$ = new ReplaySubject(1); constructor(private cmsFacade: CMSFacade) {} ngOnInit() { - this.contentInclude$ = this.cmsFacade.contentInclude$(this.includeIdChange); + this.contentInclude$ = this.cmsFacade.contentInclude$(this.includeIdChange$); } ngOnChanges() { - this.includeIdChange.next(this.includeId); + this.includeIdChange$.next(this.includeId); } }