ml-event

0.0.3 • Public • Published

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);

Readme

Keywords

none

Package Sidebar

Install

npm i ml-event

Weekly Downloads

1

Version

0.0.3

License

Apache2

Last publish

Collaborators

  • iamblue