1.2.2 • Published 2 years ago

@notscottiguess/jvent v1.2.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Simple event system for events between objects

Creating a new event

const myEvent = new Jvent("optional name");

Add Handlers Anonymous functions

myEvent.add(function(e){
  // use with caution. this might not be what you expect
  console.log(e);
});

myEvent.add((e) => {
  console.log(e);
});

Object methods

class Example{

  constructor(myEvent){
    myEvent.add(this, "fired");
  }

  fired(e){
    console.log(e);
  }

}

Firing Events

myEvent.fire({some: "data"});
1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago