Skip to content
/ jMess Public

A simple event driven messaging framework for javascript.

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE.html
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

G3N7/jMess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 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.

Release Notes

3.0

This we have removed the dependency on underscore, this has a few effects:

  • We are now using Array.prototype.map(), Array.prototype.indexOf, and Object.keys. Consult Can I Use, ES5 for compatibility
  • You can now choose how you reference underscore, should you choose too.
  • Removes a heafty dependency in simple scenarios.

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