uemitter
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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');
})();

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i uemitter

    Weekly Downloads

    1

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • dgeibi