diff --git a/src/Umbraco.Web.UI.Client/libs/observable-api/array-state.ts b/src/Umbraco.Web.UI.Client/libs/observable-api/array-state.ts index fa4d27a6fd..303e3b3874 100644 --- a/src/Umbraco.Web.UI.Client/libs/observable-api/array-state.ts +++ b/src/Umbraco.Web.UI.Client/libs/observable-api/array-state.ts @@ -21,7 +21,7 @@ export class ArrayState extends DeepState { /** * @method append * @param {unknown} unique - The unique value to remove. - * @returns ArrayState + * @return {ArrayState} Reference to it self. * @description - Remove some new data of this Subject. * @example Example remove entry with key '1' * const data = [ @@ -51,7 +51,7 @@ export class ArrayState extends DeepState { /** * @method filter * @param {unknown} filterMethod - The unique value to remove. - * @returns ArrayState + * @return {ArrayState} Reference to it self. * @description - Remove some new data of this Subject. * @example Example remove entry with key '1' * const data = [ @@ -77,7 +77,7 @@ export class ArrayState extends DeepState { /** * @method appendOne * @param {T} entry - new data to be added in this Subject. - * @returns ArrayState + * @return {ArrayState} Reference to it self. * @description - Append some new data to this Subject. * @example Example append some data. * const data = [ @@ -101,7 +101,7 @@ export class ArrayState extends DeepState { /** * @method append * @param {T[]} entries - A array of new data to be added in this Subject. - * @returns ArrayState + * @return {ArrayState} Reference to it self. * @description - Append some new data to this Subject, if it compares to existing data it will replace it. * @example Example append some data. * const data = [ diff --git a/src/Umbraco.Web.UI.Client/libs/observable-api/object-state.ts b/src/Umbraco.Web.UI.Client/libs/observable-api/object-state.ts index 5175616f20..e726a075bb 100644 --- a/src/Umbraco.Web.UI.Client/libs/observable-api/object-state.ts +++ b/src/Umbraco.Web.UI.Client/libs/observable-api/object-state.ts @@ -12,15 +12,17 @@ import { DeepState } from "./deep-state"; export class ObjectState extends DeepState { /** - * @method append - * @param {Partial} partialData - A object containing some of the data for this Subject. + * @method update + * @param {Partial} partialData - A object containing some of the data to update in this Subject. * @description - Append some new data to this Object. + * @return {ObjectState} Reference to it self. * @example Example append some data. * const data = {key: 'myKey', value: 'myInitialValue'}; - * const mySubject = new ObjectState(data) - * mySubject.append({value: 'myNewValue'}) + * const myState = new ObjectState(data); + * myState.update({value: 'myNewValue'}); */ update(partialData: Partial) { this.next({ ...this.getValue(), ...partialData }); + return this; } }