map.apps Bundle APIs 4.20.0
    Preparing search index...

    Function EventedMixin

    • Evented Mixin function. Creates new clazz which inherits from a given clazz and extends it with on/emit functions.

      Type Parameters

      • BaseType extends Constructor<any, any>

      Parameters

      Returns Constructor<
          InstanceType<BaseType> & Evented<any>,
          ConstructorParameters<BaseType>,
      >

      class which inherits from Base.

      import { EventedMixin } from "apprt-core/Events";

      const MyClass = EventedMixin(class {
      trigger() {
      (this as any).emit("changed", true);
      }
      });
      const myClassInstance = new MyClass();
      myClassInstance.trigger();