0.3.1 • Published 7 months ago

fire-event-emitter v0.3.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 months ago

fire-event-emitter

event register && event emitter && set-get

use

import FireEventEmitter from 'fire-event-emitter';

const Emitter = new FireEventEmitter();
const callback = jest.fn();
const callback2 = jest.fn();

Emitter.on('type1', callback);
Emitter.on('type1', callback2);
Emitter.on('type2', callback);
Emitter.emit('type1', 'type1')
Emitter.emit('type2', 'type2')
Emitter.off('type2');
Emitter.off('type1', callback);

Emitter.set('a', '123');
Emitter.get('a'); // 123
Emitter.rm('a');
Emitter.get('a'); // undefined
0.3.0

7 months ago

0.3.1

7 months ago

0.2.0

3 years ago

0.1.0

3 years ago