Skip to content

janderudder/Event-System-Javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Event-System-Javascript

A naive event system working made of three elements: event-hub, emitter and receiver.

See the console output of example.html and the code in example.js for full usage documentation.

Example

// Subscribe to a type of event and create a callback
listener.receiver.subscribeToEvent(hub, 'TYPE0', (event, sender, hub) => {
  console.info('Event Callback executing for category:', event.category)
  console.info('Payload received:', event.payload)
  console.info('From sender: ', sender)
  console.info('From hub: ', hub)
})

// Our talker emits an event
talker.emitter.emit(new Event('TYPE0', { hello: 'world' }))

output of example.js

About

A naive event system made of three elements: event-hub, emitter and receiver.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published