simple-event-listener
v1.0.0
Published
This module was designed to simplify the use of event listener for frontend applications, especially for applications that use components, making the process of event streams simpler.
Readme
TS: Example of use
import { simpleEventListener } from "simple-event-listener";
const my_function = ({detail}) => {
const {my_atribute} = detail
if(my_atribute){
console.log(`My value attr: ${my_atribute}`)
}
}
simpleEventListener.on('my_function',my_function)
simpleEventListener.emit('my_function',{
my_atribute : "Hello world"
})
simpleEventListener.destroy('my_function')
Result example
My value attr: Hello world