refactor: rename onUpdate$ to createOnUpdateStream

pull/6156/head
mehmet-erim 5 years ago
parent 8569cc9963
commit 79d3168427

@ -20,7 +20,7 @@ export class OAuthConfigurationHandler {
private listenToSetEnvironment() {
this.environmentService
.onUpdate$(state => state)
.createOnUpdateStream(state => state)
.pipe(
map(environment => environment.oAuthConfig),
filter(config => !compare(config, this.options.environment.oAuthConfig)),

@ -51,7 +51,7 @@ export class AuthService {
};
private listenToSetEnvironment() {
this.environment.onUpdate$(state => state.oAuthConfig).subscribe(this.setStrategy);
this.environment.createOnUpdateStream(state => state.oAuthConfig).subscribe(this.setStrategy);
}
login(username: string, password: string): Observable<any> {

@ -10,7 +10,9 @@ import { InternalStore } from '../utils/internal-store-utils';
export class ConfigStateService {
private readonly store = new InternalStore({} as ApplicationConfiguration.Response);
readonly onUpdate$ = this.store.sliceUpdate;
get createOnUpdateStream() {
return this.store.sliceUpdate;
}
setState = (state: ApplicationConfiguration.Response) => {
this.store.patch(state);

@ -8,7 +8,7 @@ import { InternalStore } from '../utils/internal-store-utils';
export class EnvironmentService {
private readonly store = new InternalStore({} as Environment);
get onUpdate$() {
get createOnUpdateStream() {
return this.store.sliceUpdate;
}

@ -193,7 +193,6 @@ function getLocalization(
return defaultValue || sourceKey;
}
// [TODO]: next line should be removed in v3.2, breaking change!!!
interpolateParams = interpolateParams.filter(params => params != null);
if (localization) localization = interpolate(localization, interpolateParams);

@ -153,7 +153,9 @@ export abstract class AbstractNavTreeService<T extends ABP.Nav>
constructor(protected injector: Injector) {
super();
const configState = this.injector.get(ConfigStateService);
this.subscription = configState.onUpdate$(state => state).subscribe(() => this.refresh());
this.subscription = configState
.createOnUpdateStream(state => state)
.subscribe(() => this.refresh());
this.permissionService = injector.get(PermissionService);
}

@ -1,10 +1,10 @@
import { Injectable } from '@angular/core';
import compare from 'just-compare';
import { filter, take } from 'rxjs/operators';
import { ApplicationConfiguration } from '../models/application-configuration';
import { Session } from '../models/session';
import { InternalStore } from '../utils/internal-store-utils';
import compare from 'just-compare';
import { ConfigStateService } from './config-state.service';
import { filter, take, tap } from 'rxjs/operators';
export interface SessionDetail {
openedTabCount: number;
@ -42,7 +42,6 @@ export class SessionStateService {
this.configState
.getDeep$('localization.currentCulture.cultureName')
.pipe(
tap(console.warn),
filter(cultureName => !!cultureName),
take(1),
)

Loading…
Cancel
Save