jetemit, events manager for react, react-native, vue, angular and all javascript project
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
.npmignore
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
PULL_REQUEST_TEMPLATE.md
README.md
index.js
index.test.js
package.json

README.md

jetemit

NPM

install size dependencies

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