utsubo-events

0.0.1 • Public • Published

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
}

Readme

Keywords

none

Package Sidebar

Install

npm i utsubo-events

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

7.85 kB

Total Files

4

Last publish

Collaborators

  • onirenaud