From f9dae8231f38f276f0019cfecf1b865da9a0c27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 11 Jan 2023 11:29:41 +0100 Subject: [PATCH] rename CreateObservablePart to lower case --- .../workspace-property/workspace-property.context.ts | 12 ++++++------ .../workspace-content/workspace-content.context.ts | 4 ++-- .../users/current-user/current-user-history.store.ts | 4 ++-- .../core/observable-api/unique-behavior-subject.ts | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace-property/workspace-property.context.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace-property/workspace-property.context.ts index 9a7b91d7f6..37e20d25ff 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace-property/workspace-property.context.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace-property/workspace-property.context.ts @@ -1,7 +1,7 @@ import { UmbWorkspaceContentContext } from "../workspace/workspace-content/workspace-content.context"; import type { DataTypeDetails } from "@umbraco-cms/models"; import { UmbControllerHostInterface } from "src/core/controller/controller-host.mixin"; -import { CreateObservablePart, UniqueBehaviorSubject } from "src/core/observable-api/unique-behavior-subject"; +import { createObservablePart, UniqueBehaviorSubject } from "src/core/observable-api/unique-behavior-subject"; import { UmbContextProviderController } from "src/core/context-api/provide/context-provider.controller"; import { UmbContextConsumerController } from "src/core/context-api/consume/context-consumer.controller"; @@ -31,11 +31,11 @@ export class UmbWorkspacePropertyContext { private _data = new UniqueBehaviorSubject>({}); - public readonly alias = CreateObservablePart(this._data, data => data.alias); - public readonly label = CreateObservablePart(this._data, data => data.label); - public readonly description = CreateObservablePart(this._data, data => data.description); - public readonly value = CreateObservablePart(this._data, data => data.value); - public readonly config = CreateObservablePart(this._data, data => data.config); + public readonly alias = createObservablePart(this._data, data => data.alias); + public readonly label = createObservablePart(this._data, data => data.label); + public readonly description = createObservablePart(this._data, data => data.description); + public readonly value = createObservablePart(this._data, data => data.value); + public readonly config = createObservablePart(this._data, data => data.config); private _workspaceContext?: UmbWorkspaceContentContext; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts index 43f51e15dc..cf660a7e7b 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/components/workspace/workspace-content/workspace-content.context.ts @@ -7,7 +7,7 @@ import { UmbContextConsumerController } from 'src/core/context-api/consume/conte import { UmbObserverController } from '@umbraco-cms/observable-api'; import { UmbContextProviderController } from 'src/core/context-api/provide/context-provider.controller'; import { EntityTreeItem } from '@umbraco-cms/backend-api'; -import { CreateObservablePart, UniqueBehaviorSubject } from 'src/core/observable-api/unique-behavior-subject'; +import { createObservablePart, UniqueBehaviorSubject } from 'src/core/observable-api/unique-behavior-subject'; // TODO: Consider if its right to have this many class-inheritance of WorkspaceContext // TODO: Could we extract this code into a 'Manager' of its own, which will be instantiated by the concrete Workspace Context. This will be more transparent and 'reuseable' @@ -45,7 +45,7 @@ export abstract class UmbWorkspaceContentContext< this._data = new UniqueBehaviorSubject(defaultData); this.data = this._data.asObservable(); - this.name = CreateObservablePart(this._data, data => data.name); + this.name = createObservablePart(this._data, data => data.name); this.entityType = entityType; diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/users/current-user/current-user-history.store.ts b/src/Umbraco.Web.UI.Client/src/backoffice/users/current-user/current-user-history.store.ts index 19b0e1a1b6..1936ef5bde 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/users/current-user/current-user-history.store.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/users/current-user/current-user-history.store.ts @@ -1,4 +1,4 @@ -import { CreateObservablePart, UniqueBehaviorSubject } from 'src/core/observable-api/unique-behavior-subject'; +import { createObservablePart, UniqueBehaviorSubject } from 'src/core/observable-api/unique-behavior-subject'; export type UmbModelType = 'dialog' | 'sidebar'; @@ -15,7 +15,7 @@ export class UmbCurrentUserHistoryStore { ); public readonly history = this.#history.asObservable(); - public readonly latestHistory = CreateObservablePart(this.#history, historyItems => historyItems.slice(-10)); + public readonly latestHistory = createObservablePart(this.#history, historyItems => historyItems.slice(-10)); constructor() { diff --git a/src/Umbraco.Web.UI.Client/src/core/observable-api/unique-behavior-subject.ts b/src/Umbraco.Web.UI.Client/src/core/observable-api/unique-behavior-subject.ts index acc462468a..561d112266 100644 --- a/src/Umbraco.Web.UI.Client/src/core/observable-api/unique-behavior-subject.ts +++ b/src/Umbraco.Web.UI.Client/src/core/observable-api/unique-behavior-subject.ts @@ -68,7 +68,7 @@ function defaultMemoization(previousValue: any, currentValue: any): boolean { /** * @export - * @method CreateObservablePart + * @method createObservablePart * @param {Observable} source - RxJS Subject to use for this Observable. * @param {(mappable: T) => R} mappingFunction - Method to return the part for this Observable to return. * @param {(previousResult: R, currentResult: R) => boolean} [memoizationFunction] - Method to Compare if the data has changed. Should return true when data is different. @@ -76,7 +76,7 @@ function defaultMemoization(previousValue: any, currentValue: any): boolean { * @example Example create a Observable for part of the data Subject. * public readonly myPart = CreateObservablePart(this._data, (data) => data.myPart); */ -export function CreateObservablePart ( +export function createObservablePart ( source$: Observable, mappingFunction: MappingFunction, memoizationFunction?: MemoizationFunction