ear

v1.0.1
Manage and call change listeners
listener change callback event

ear Build Status

Manage and call change listeners

Install

$ npm install --save ear

Usage

var Listeners = require('ear')
var listeners = Listeners()
listeners.add(function (a, b) {
  //=> hello
  //=> world
})
listeners('hello', 'world')

API

Listeners() -> function

Create a new listener group. Returns a listeners function that will call all listeners with the provided arguments.

listeners.add(listener) -> function

Adds a new listener. Returns a remove function that will remove the new listener when called.

listener

Required
Type: function

A listener to trigger when the parent function is called.

License

MIT © Ben Drucker

npm i ear

Metadata

  • MIT
  • >=0.10.0
  • Ben Drucker
  • released 7/2/2015

Downloads

Maintainers