Skip to content

About

JavaScript events for custom objects

Resources

Stars

329 stars

Watchers

14 watching

Forks

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eventdispatcher.js

JavaScript events for custom objects

Usage

import { EventDispatcher } from 'EventDispatcher.js';

// Adding events to custom object

class Car extends EventDispatcher {

	start() {

		this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } );

	}

}

// Using events

const car = new Car();

car.addEventListener( 'start', function ( event ) {

	alert( event.message );

} );

car.start();

About

JavaScript events for custom objects

Resources

Stars

329 stars

Watchers

14 watching

Forks

Releases

Packages

Contributors

Languages