0.0.4 • Published 8 years ago

uemitter v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

uemitter

Install

$ npm install uemitter

Usage

import Emitter from 'uemitter';
// or // const Emitter = require('uemitter');

const emitter = Emitter();

// listen to an event
emitter.once('foo', async () => {
  const data = await fetch('example.com/foo.json').then(res => res.json());
  // do something with data
});

(async () => {
  // emit an event
  await emitter.emitAsync('foo');
})();