forked from G3N7/jMess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
32 lines (21 loc) · 1.7 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<h1>jMess</h1>
<p>A simple event driven messaging framework for javascript.</p>
<h2>Components</h2>
<h3>EventRegistry</h3>
<p>This is the heart of the system, it allows you to raise and hook to events while passing messages through your system.</p>
<ul>
<li><code>hook(eventName: string, onRaise: Function): () => void</code> - 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.</li>
<li><code>raise(eventToRaise: string, data: Object): void</code> - will raise an event passing the expected data along to each of the delegates registered to the event.</li>
<li><code>register(eventsToRegister: string/Object/string[]): void</code> - allows you to register events, although this step may seem unnecessary i have found it very useful in diagnosing typos in event names.</li>
<li><code>getAvailableEvents(): string[]</code> - allows you to see all currently registered events, this is mostly used for diagnostics.</li>
</ul>
<h3>EventBarker</h3>
<p>A little logging tool to allow for a console log stream of the events passing through the system. Simply tell it to <code>startBarking()</code></p>
<h3>LifeCycleEvents</h3>
<p>These events give you access points to have logic run across all commands at different points in the life cycle.</p>
<h2>About the project</h2>
<ul>
<li>Our project is written in typescript but compiled to target ECMAScript v5.</li>
<li>Currently depends on Underscore.js for some utilities with a terse syntax, as needed the project can be migrated off of it.</li>
<li>Uses the ILogR interface for logging. Check out my ILogR project for an implementation with some jazz :D</li>
</ul>