befall
v1.3.2
Published
Lightweight events lib
Downloads
3
Maintainers
Readme
Befall — tiny events library
API
import befall from 'befall';
// Create emitter
const onInit = befall();
// Register event handler
onInit((greeting, name) => {
console.log(`${greeting}, ${name}`);
});
// Execute all registered handlers
onInit('Hello', 'dear user');
// Unregister handler
onInit.off(someHandlerFunction);