Skip to content

bendrucker/ear

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Related

License

MIT © Ben Drucker

About

Manage and call change listeners

Resources

License

Stars

Watchers

Forks

Packages

No packages published