Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A uniform interface for listening and removing events on DOM elements, EventEmitter and what not.

NotificationsYou must be signed in to change notification settings

unshiftio/hearing-aid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hearing-aid provides a uniform interface for listening to and removing eventlisteners. It supports DOM elements, EventEmitters -- anything with an eventinterface basically.

Installation

The module is released in the public npm interface.

npm install --save heairing-aid

Usage

The module exposes a single function that is used to listen to all the things.When you assigned the listener it returns a function that does the clean up.

varhearing=require('hearing-aid');varremove=hearing(window,'resize',function(){//// Remove the listener.//remove();});

As you can see in the example above, the following arguments are required:

  • The thing you want to listen on. It can be any event supporting interface.
  • The name of the event you want to listen for.
  • The function that should be triggered.

About

A uniform interface for listening and removing events on DOM elements, EventEmitter and what not.

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp