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);
});
 

Readme

Keywords

none

Package Sidebar

Install

npm i EventField

Weekly Downloads

2

Version

2.0.0

License

MIT

Last publish

Collaborators

  • icholy