Skip to content

[TNS3.0 RC] How to extend an Observable? #4009

@NordlingDev

Description

@NordlingDev

In 3.0 RC, the Observable constructor is deprecated for public use, meaning we only use static methods such as observable.fromObject and observable.fromObjectRecursive.

In 2.5.x, I could do this:

const MyObservable = (function(_super) {
  __extends(MyObservable, _super);
  function MyObservable() {
    this.foo = "bar";
  }
  
  return MyObservable;
})(Observable);

const data = new MyObservable();

But in 3.0 RC, using the Observable class is no longer advised, and we cannot extend fromObject or fromObjectRecursive since they are static methods. So how is it done?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions