rename CreateObservablePart to lower case

This commit is contained in:
Niels Lyngsø
2023-01-11 11:29:41 +01:00
parent 7ee2665781
commit f9dae8231f
4 changed files with 12 additions and 12 deletions

View File

@@ -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<ValueType = unknown> {
private _data = new UniqueBehaviorSubject<WorkspacePropertyData<ValueType>>({});
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;

View File

@@ -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<ContentTypeType>(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;

View File

@@ -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() {

View File

@@ -68,7 +68,7 @@ function defaultMemoization(previousValue: any, currentValue: any): boolean {
/**
* @export
* @method CreateObservablePart
* @method createObservablePart
* @param {Observable<T>} 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 <caption>Example create a Observable for part of the data Subject.</caption>
* public readonly myPart = CreateObservablePart(this._data, (data) => data.myPart);
*/
export function CreateObservablePart<T, R> (
export function createObservablePart<T, R> (
source$: Observable<T>,
mappingFunction: MappingFunction<T, R>,
memoizationFunction?: MemoizationFunction<R>