observer-emit
v1.0.1
Published
๐ A Node.js event emitter works in the browser
Downloads
4
Maintainers
Readme
observer-emit
๐ A Node.js event emitter works in the browser.
Install
using npm
$ npm i observer-emit
using yarn
$ yarn add observer-emit
using pnpm
$ pnpm i observer-emit
Usage
import observer from 'observer-emit'
observer.on('asuka', () => console.log('asuka', 1))
observer.on('nagi', () => console.log('nagi'))
observer.off('asuka')
observer.on('asuka', () => console.log('asuka', 2))
observer.emit('asuka') // asuka 2
observer.emit('nagi') // nagi
observer.once('ume', () => console.log('ume'))
observer.emit('ume') // ume
observer.emit('ume')
observer.emit('ume')
License
MIT License ยฉ 2022 Akashi Sai