Skip to content

jetemit, events manager for react, react-native, vue, angular and all javascript project

License

Notifications You must be signed in to change notification settings

abolfazl930/jetemit

 
 

Repository files navigation

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

About

jetemit, events manager for react, react-native, vue, angular and all javascript project

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%