Nautical Pirate Moustache
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

jetemit

3.1.1 • Public • Published

jetemit

NPM

install size dependencies

Version License Downloads

events manager very simple

Compatibility

All browser Backend (Nodejs) Mobile (React Native)

Compatibility with all javascript project

install

npm install jetemit --save

import

const { on, emit } = require('jetemit');
//or
import { on, emit } from 'jetemit';

use

call

import { emit } from 'jetemit';
/**
 * emit(name, value);
 * name is string
 * value any 
 */
emit('TIME', '2018-12-01 12:30');

listener

import { on } from 'jetemit';
/**
 * on(name,function)
 * name is string
 */
on('TIME', time => {
  console.log(time);
});

unsubscribe listener

import { on } from 'jetemit';
/**
 * on return unsubscribe function
 */
const unsubscribe = on('TIME', time => {
  console.log(time);
});
 
unsubscribe();

Keywords

none

install

npm i jetemit

Downloadsweekly downloads

15

version

3.1.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability