Skip to content

VaTka/EventSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

EventSystem

The EventSystem class provides a basic event handling mechanism

Example usage:

const eventSystem = new EventSystem();

// Add event listener
function eventHandler(data: any) {
  console.log("Event occurred with data:", data);
}
eventSystem.on('exampleEvent', eventHandler); // eventName: string, callback: Callback

// Trigger event
eventSystem.emit('exampleEvent', { message: 'Hello, world!' }); // eventName: string, data?: any

// Remove event listener
eventSystem.off('exampleEvent', 1); // eventName: string, id: number

About

The EventSystem class provides a basic event handling mechanism

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published