@espressif/rainmaker-base-cdf
    Preparing search index...

    Function makeEverythingObservable

    • Recursively makes all properties of an object observable.

      This function traverses an object and makes every property observable, including nested objects and arrays of objects. If a property is already observable, it will not be modified.

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        The object to be made observable.

      • visited: WeakSet<object> = ...

      Returns T

      • The observable version of the input object.
      const obj = { a: 1, b: { c: 2 } };
      const observableObj = makeEverythingObservable(obj);
      console.log(isObservable(observableObj)); // true
      console.log(isObservable(observableObj.b)); // true

      This function is useful in scenarios where you need to ensure that all parts of an object, including deeply nested properties, are observable by Mobx. This is particularly useful in state management for reactive programming.