@umbraco-cms/backoffice
    Preparing search index...

    Class UmbObjectState<T>

    UmbObjectState

    • A RxJS BehaviorSubject which deepFreezes the object-data to ensure its not manipulated from any implementations. Additionally the Subject ensures the data is unique, not updating any Observes unless there is an actual change of the content.

    The UmbObjectState provides methods to append data when the data is an Object.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index
    _subject: BehaviorSubject<T>
    • get value(): T

      Returns T

      Observable that

      • Holds the current data of this state.
      const myState = new UmbArrayState('Hello world');
      console.log("Value is: ", myState.value);
    • Function

      asObservable

      Returns Observable<T>

      Observable that the State casts to.

      • Creates a new Observable with this State as the source. Observe this to subscribe to its value and future changes.
      const myState = new UmbArrayState('Hello world');

      this.observe(myState, (latestStateValue) => console.log("Value is: ", latestStateValue));
    • Function

      getMutePromise

      Returns Promise<boolean>

      • Returns a promise which resolves to true if the state was muted and is now unmuted, or false if the state was not muted.
      • Get a promise which resolves when the mute is unset.
    • Function

      getValue

      Returns T

      The current data of this state.

      • Provides the current data of this state.
      const myState = new UmbArrayState('Hello world');
      console.log("Value is: ", myState.value);
    • Function

      update

      Parameters

      • partialData: Partial<T>

        A object containing some of the data to update in this Subject.

      Returns UmbObjectState<T>

      Reference to it self.

      • Append some new data to this Object.
      const data = {key: 'myKey', value: 'myInitialValue'};
      const myState = new UmbObjectState(data);
      myState.update({value: 'myNewValue'});