close

Filter

loading table of contents...

CoreMedia Content Cloud v11 Upgrade Guide / Version 2110

Table Of Contents

7.3.1.4 A Complete Example Class

Using all the ingredients of the previous sections, the complete example class could look like so:

 import { is, mixin } from "@jangaroo/runtime";
import SuperFoo from "./SuperFoo";
import IFoo from "../api/IFoo";

class Foo extends SuperFoo implements IFoo {
  static readonly FOO: any = "FOO";
  foo: string;
  #bar: number;

  constructor(newBar: number) {
    super();
    this.#bar = newBar;
  }

  get bar(): number {
    return this.#bar;
  }

  set bar(value: number) {
    this.#bar = value;
  }

  isAFoo(obj: any): boolean {
    return is(obj, IFoo);
  }

  protected hook(): boolean {
    return false;
  }
}

mixin(Foo, IFoo);

default export Foo; 

Example 7.2.  TypeScript example class


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.