nanoevents

Simple and tiny (107 bytes) event emitter library

nanoevents downloads nanoevents version nanoevents license

nanoevents類似パッケージ:

npmのダウンロードトレンド

3 年
🌟 nanoeventsのREADME.mdにリアルタイム使用チャートを表示するには、以下のコードをコピーしてください。
## Usage Trend
[![Usage Trend of nanoevents](https://npm-compare.com/img/npm-trend/THREE_YEARS/nanoevents.png)](https://npm-compare.com/nanoevents#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 nanoeventsのREADME.mdにGitHub Starsトレンドチャートを表示するには、以下のコードをコピーしてください。
## GitHub Stars Trend
[![GitHub Stars Trend of nanoevents](https://npm-compare.com/img/github-trend/nanoevents.png)](https://npm-compare.com/nanoevents)

統計詳細

パッケージ
ダウンロード数
Stars
サイズ
Issues
公開日時
ライセンス
nanoevents01,6275.43 kB02年前MIT

nanoevents のREADME

Nano Events

Simple and tiny event emitter library for JavaScript.

  • Only 108 bytes (minified and brotlied). It uses Size Limit to control size.
  • The on method returns unbind function. You don’t need to save callback to variable for removeListener.
  • TypeScript and ES modules support.
  • No aliases, just emit and on methods. No Node.js EventEmitter compatibility.
import { createNanoEvents } from 'nanoevents'

const emitter = createNanoEvents()

const unbind = emitter.on('tick', volume => {
  summary += volume
})

emitter.emit('tick', 2)
summary //=> 2

unbind()
emitter.emit('tick', 2)
summary //=> 2

  Made at Evil Martians, product consulting for developer tools.


Docs

Read full docs here.