This package has been deprecated

Author message:

using @mixspa/core instead

@mixspa/events

0.3.0 • Public • Published

Mixspa Events

This is a simple pubsub for mixspa with window custom event. This library only can be used in browser.

Current Status:

NPM Version NPM Downloads Build Status

NPM

How to use?

import MixspaEvent from 'mixspa-events'
/*
MixspaEvent.on('[namespace]:[module]:[action]': String, callback: Function) : Listener;
*/
let listener = MixspaEvent.on('mixspa:test:update', (message) => {
  console.log(message);
});

/*
MixspaEvent.emit('[namespace]:[module]:[action]': String, message: Object);
*/
MixspaEvent.emit('mixspa:test:update', 'Hello Test');

/*
MixspaEvent.off('[namespace]:[module]:[action]': String, listener: Object);
*/
MixspaEvent.off('mixspa:test:update', listener);

License

mixspa-events is released under the MIT license.

Package Sidebar

Install

npm i @mixspa/events

Weekly Downloads

8

Version

0.3.0

License

MIT

Unpacked Size

5.83 kB

Total Files

7

Last publish

Collaborators

  • xqcao