observer-emit
TypeScript icon, indicating that this package has built-in type declarations

1.0.1ย โ€ขย Publicย โ€ขย Published

observer-emit

๐Ÿ‘€ A Node.js event emitter works in the browser.

NPM version

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.10latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.10
1.0.00
0.0.6-beta.11
0.0.5-beta.30
0.0.5-beta.20
0.0.5-beta.00
0.0.40
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i observer-emit

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

7.36 kB

Total Files

6

Last publish

Collaborators

  • akashi_sai