# ainojs-events

> Simple event interface, suitable for prototype mixin

Latest version **1.2.0** (published 2015-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install ainojs-events
pnpm add ainojs-events
yarn add ainojs-events
bun add ainojs-events
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2015-12-08 |
| First published | 2014-07-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Aino |
| Maintainers | aino |

## Links

- npm: https://www.npmjs.com/package/ainojs-events
- Repository: https://github.com/aino/ainojs-events
- Issues: https://github.com/aino/ainojs-events/issues
- npm.io page: https://npm.io/package/ainojs-events

## Recent versions

- 1.2.0 (latest) — 2015-12-08
- 1.1.3 — 2015-03-24
- 1.1.2 — 2015-03-24
- 1.1.1 — 2014-12-10
- 1.1.0 — 2014-12-10
- 1.0.10 — 2014-12-10
- 1.0.9 — 2014-12-09
- 1.0.8 — 2014-12-09
- 1.0.7 — 2014-10-15
- 1.0.6 — 2014-10-05
- 1.0.5 — 2014-09-17
- 1.0.4 — 2014-07-28
- 1.0.3 — 2014-07-05
- 1.0.2 — 2014-07-05
- 1.0.1 — 2014-07-05
- … 1 more at https://npm.io/package/ainojs-events/versions

## README

Events
------

Simple event interface, suitable for mixin.

Example:

    var GreatStuff = function() {
      // Apply the mixin
      Events.mixin(this)
    }

    GreatStuff.prototype.whatever = function() {
      this.trigger('whatever', { foo: 'bar' })
    }

    // [...]

    var stuff = new GreatStuff()
    stuff.on('whatever', function(e) {
      console.log(e.foo) // "bar"
    })
    stuff.whatever()

Now your class will implement a simple event interface.

Methods:

    on(type, callback)
    off(type[, callback])
    trigger(type[, params])
    once(type, callback)

---
_Source: https://npm.io/package/ainojs-events · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
