Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.7 to 0.1.8

2

package.json
{
"version": "0.1.7",
"version": "0.1.8",
"name": "call-func",

@@ -4,0 +4,0 @@ "repository": {

@@ -1,24 +0,30 @@

Call Function
===============
* GIT
* https://github.com/react-atomic/react-atomic-organism/tree/main/packages/lib/call-func
* NPM
* https://www.npmjs.com/package/call-func
# Call Function
- GIT
- https://github.com/react-atomic/react-atomic-organism/tree/main/packages/lib/call-func
- NPM
- https://www.npmjs.com/package/call-func
## `Event addEventListener wrapper`
* `subscribe`
__HTML__
- `subscribe`
**HTML**
```html
<button>Click</button>
```
__JS__
**JS**
```js
import {register, cleanAllRegister} from "call-func";
import { register, cleanAllRegister } from "call-func";
const oReg = register(document.querySelector("button"));
const regId = oReg.addEventListener("click", ()=>{console.log("click")});
const regId = oReg.addEventListener("click", () => {
console.log("click");
});
```
* `unsubscribe` by id
- `unsubscribe` by id
```js

@@ -28,7 +34,12 @@ // clean one

// clean all
// clean one dom events by type.
oReg.cleanAll("click");
// clean one dom all events.
oReg.cleanAll();
// clean events which regist by this library.
cleanAllRegister();
```
* [More Example](https://github.com/react-atomic/react-atomic-organism/blob/main/packages/lib/call-func/src/__tests__/registerTest.js)
- [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