Comparing version 0.1.7 to 0.1.8
{ | ||
"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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31993
45