@asandmann/events
v1.0.0
Published
very fast events
Downloads
3
Readme
@asandmann/events
usage
nodejs
import EventEmitter from '@asandmann/events';
const emitter = new EventEmitter();
emitter.on('cheese', (gluten) => {
if (Array.isArray(gluten) === true) gluten[gluten.length] = gluten[0];
});
emitter.emit('cheese', ['a', 'b', 'c']);
deno
import EventEmitter from 'https://unpkg.com/@asandmann/[email protected]/dist/index.js';
const emitter = new EventEmitter();
emitter.on('cheese', (gluten) => {
if (Array.isArray(gluten) === true) gluten[gluten.length] = gluten[0];
});
emitter.emit('cheese', ['a', 'b', 'c']);
benchmarks
drip x 532,799 ops/sec ±1.29% (291 runs sampled)
@asandmann/events x 1,419,332 ops/sec ±0.32% (293 runs sampled)
native x 1,095,307 ops/sec ±0.59% (290 runs sampled)
eventemitter3 x 513,031 ops/sec ±0.21% (292 runs sampled)