Socket
Socket
Sign inDemoInstall

event-deleg

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    event-deleg

A javascript event delegation library


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Event delegation

An event delegate library.

Usage

const handleClick = () => {
  ...
}

// listener
on(button, 'click', handleClick)

// stop
off(button, 'click', handleClick)

// The last parameter is the same as the third parameter of addEventListener
// See https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener
on(button, 'click', handleClick, true)

// event delegation
on(div, 'click', 'li', handleClick)

// stop
off(div, 'click', handleClick)

// capture
on(div, 'click', 'li', handleClick, true)

Keywords

FAQs

Last updated on 08 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc