Skip to content

sweetlandj/jMess

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jMess

A simple event driven messaging framework for javascript.

EventRegistry

This is the heart of the system, it allows you to raise and hook to events while passing messages through your system.


hook(eventName: string, onRaise: Function): () => void

will register a delegate to be invoked upon raising the event and then return a cancelation function that can be called to remove the hook that was just registered.


raise(eventToRaise: string, data: Object): void

will raise an event passing the expected data along to each of the delegates registered to the event.


register(eventsToRegister: string/Object/string[]): void

allows you to register events, although this step may seem unnecessary i have found it very useful in diagnosing typos in event names.


getAvailableEvents(): string[]

allows you to see all currently registered events, this is mostly used for diagnostics.

###EventBarker### A little logging tool to allow for a console log stream of the events passing through the system. Simply tell it to

startBarking()

###LifeCycleEvents### These events give you access points to have logic run across all commands at different points in the life cycle.

##About the project##

  • Our project is written in typescript but compiled to target ECMAScript v5.
  • Currently depends on Underscore.js for some utilities with a terse syntax, as needed the project can be migrated off of it.
  • Uses the ILogR interface for logging. Check out my ILogR project for an implementation with some jazz :D

About

A simple event driven messaging framework for javascript.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE.html
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.0%
  • TypeScript 6.5%
  • Other 0.5%