utsubo-events

v0.0.1
react library for custom events

Utsubo-events

Minimalist library to emit and receive custom events. useEvents will be automatically attached on mounted and detached on unmounted.

import {emitEvents, useEvents} from 'utsubo-events'

emitEvent((payload) => {
  // payload = 5
})


const DummyComponent = () => {
  useEvents((payload) => {
    // payload = 5
  }, {once: false})

  return null
}
npm i utsubo-events

Metadata

  • MIT
  • Whatever
  • Renaud Rohlinger
  • released 9/16/2021

Downloads

Maintainers