jmessenger

0.0.3 • Public • Published

JMessenger

NPM version Travis CI Test coverage Dependencies status Dev Dependencies status License

NPM install

JMessenger is no longer maintained. Please, use @mobilabs/messenger now.

JMessenger is a tiny Javascript library to handle messages that carry a payload. It is designed to be embedded in another library.

Quick Startup

 
// Creates the messenger object:
var mess = Messenger('mycustomevent');
 
// Listens for an event:
mess.on('mycustomevent', function(payload) {
  console.log('fired mycustomevent: ' + payload);
});
 
// Fires an event:
mess.fire('mycustomevent', 'this is the payload for mycustomevent');

API

Static methods

JMessenger provides a set of static methods. You can use by typing:

JMessenger.noConflict();
Static Methods Description
noConflict returns the JMessenger variable to its previous owner,

Create a JMessenger object:

Constructor Description
JMessenger('messagename') creates the JMessenger object that handles 'messagename' messages,

Methods

Methods Description
addEvents adds events/messages,
addEventListener adds an event listener,
removeEventListener removes an event listener,
fire fires an event/message,
on alias on addEventListener,
off alias on removeEventListener,
trigger alias on fire,

License

MIT.

Readme

Keywords

Package Sidebar

Install

npm i jmessenger

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

154 kB

Total Files

30

Last publish

Collaborators

  • jclo