EventField
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

EventField:

Type Safe Event Fields

Usage:

 
class MyThing {
 
  public FooEvent = new EventField<string>();
 
  constructor() {
    setInterval(_ => this.FooEvent.emit("foo"), 1000);
  }
}
 
let thing = new MyThing();
 
thing.FooEvent.on((payload) => {
  console.log(payload);
});
 

Dependencies (8)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i EventField

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • icholy