0.0.3 • Published 8 years ago

ml-event v0.0.3

Weekly downloads
3
License
Apache2
Repository
-
Last release
8 years ago

ml-event

Usage

  • Copy this content in your Microlattice.js project.
  • global.eventStatus is the fixed name, don't change to other name.

API

/* Listening the channel event */

global.eventStatus.on('your channel name', function(data) {
  // handle the data.
});

/* emit the channel event */

global.eventStatus.on('your channel name', 'your data')

Example

global.eventStatus.on('info', function(data) {
  print(data);  // it will print `hello world` in every 2s.
})

__timer(function() {
  global.eventStatus.emit('info', 'hello world!');
}, 2000);
0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago