Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@feizheng/event-mitt
Advanced tools
A mini and light event emitter
name | args | description |
---|---|---|
on | name/*,handler | register an event |
off | name,handler | unregister an event |
emit | name,data( recommend an object) | fire an event |
one | name,data( recommend an object) | fire an event,only can register once |
once | name,data( recommend an object) | fire an event,only can execute once |
npm install -S @feizheng/event-mitt
import EventMitt from '@feizheng/event-mitt';
const Person = class { };
Object.assign(Person.prototype, EventMitt);
const p1 = new Person();
const sum = 0;
const total = 0;
// attach events:
var res = p1.on('ev1', () => {
console.log('ev1', sum);
sum = sum + 1;
});
p1.on('ev2', () => {
console.log('ev2', sum);
sum = sum + 3;
});
p1.on('ev3', () => {
console.log('ev3', sum);
sum = sum + 5;
});
p1.on('*', (name) => {
console.log('just a log', name);
total++;
});
// emit events:
p1.emit('ev1');
p1.emit('ev2');
p1.emit('ev3');
// destory:
res.destroy();
FAQs
A mini and light event emitter
The npm package @feizheng/event-mitt receives a total of 8 weekly downloads. As such, @feizheng/event-mitt popularity was classified as not popular.
We found that @feizheng/event-mitt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.