Socket
Socket
Sign inDemoInstall

call-func

Package Overview
Dependencies
2
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    call-func

call function


Version published
Weekly downloads
572
decreased by-42.51%
Maintainers
1
Install size
148 kB
Created
Weekly downloads
 

Readme

Source

Call Function

  • GIT
    • https://github.com/react-atomic/react-atomic-organism/tree/main/packages/lib/call-func
  • NPM

Event addEventListener wrapper

  • subscribe

HTML

<button>Click</button>

JS

import { register, cleanAllRegister } from "call-func";
const oReg = register(document.querySelector("button"));
const regId = oReg.addEventListener("click", () => {
  console.log("click");
});
  • unsubscribe by id
// clean one
oReg.removeEventListener(regId);

// clean one dom events by type.
oReg.cleanAll("click");

// clean one dom all events.
oReg.cleanAll();

// clean events which regist by this library.
cleanAllRegister();

Keywords

FAQs

Last updated on 30 Oct 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