1.0.0 • Published 3 years ago

simple-event-listener v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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