Evented Mixin function. Creates new clazz which inherits from a given clazz and extends it with on/emit functions.
class to inherit from.
class which inherits from Base.
Base
import { EventedMixin } from "apprt-core/Events";const MyClass = EventedMixin(class { trigger() { (this as any).emit("changed", true); }});const myClassInstance = new MyClass();myClassInstance.trigger(); Copy
import { EventedMixin } from "apprt-core/Events";const MyClass = EventedMixin(class { trigger() { (this as any).emit("changed", true); }});const myClassInstance = new MyClass();myClassInstance.trigger();
Evented Mixin function. Creates new clazz which inherits from a given clazz and extends it with on/emit functions.