Socket
Socket
Sign inDemoInstall

call-func

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

call-func - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

11

package.json
{
"version": "0.1.7",
"name": "call-func",
"version": "0.1.6",
"repository": {
"type": "git",
"url": "https://github.com/react-atomic/react-atomic-organism",
"directory": "packages/lib/call-func"
},
"homepage": "https://github.com/react-atomic/react-atomic-organism/tree/main/packages/lib/call-func",
"description": "call function",
"repository": "react-atomic/react-atomic-organism",
"keywords": ["call-function", "dom-event-wrapper"],
"main": "./build/cjs/src/index.js",
"module": "./build/es/src/index.js",
"keywords": [],
"author": "Hill <hill@kimo.com>",

@@ -10,0 +15,0 @@ "license": "MIT",

Call Function
===============
* GIT
* https://github.com/react-atomic/react-atomic-organism/tree/master/packages/lib/call-func
* https://github.com/react-atomic/react-atomic-organism/tree/main/packages/lib/call-func
* NPM

@@ -9,1 +9,26 @@ * https://www.npmjs.com/package/call-func

## `Event addEventListener wrapper`
* `subscribe`
__HTML__
```html
<button>Click</button>
```
__JS__
```js
import {register, cleanAllRegister} from "call-func";
const oReg = register(document.querySelector("button"));
const regId = oReg.addEventListener("click", ()=>{console.log("click")});
```
* `unsubscribe` by id
```js
// clean one
oReg.removeEventListener(regId);
// clean all
cleanAllRegister();
```
* [More Example](https://github.com/react-atomic/react-atomic-organism/blob/main/packages/lib/call-func/src/__tests__/registerTest.js)
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc