【文件属性】:
文件名称:bighook:轻松挂接到函数调用的开始或结束
文件大小:174KB
文件格式:ZIP
更新时间:2021-04-20 01:08:41
JavaScript
比格胡克
轻松挂接到函数调用的开始或结束
安装
npm i bighook
例子
const Bighook = require ( 'bighook' ) ;
let val1 ;
let val2 ;
const setVal1 = ( ) => {
val1 = 'Hello world!' ;
} ;
const hook = new Bighook ( setVal1 ) ;
hook
. before ( ( ) => {
val2 = 'foo' ;
} )
. after ( ( ) => {
val1 = 'bar' ;
} ) ;
hook . function ( ) ( ) ;
console . log ( val1 , val2 ) ; // "bar foo"
文件
可以在找到文档
【文件预览】:
bighook-master
----.eslintrc.json(412B)
----.gitignore(2KB)
----package.json(944B)
----docs.md(673B)
----package-lock.json(730KB)
----LICENSE(1KB)
----index.js(975B)
----_config.yml(26B)
----README.md(488B)
----test()
--------.eslintrc.json(37B)
--------test.js(1KB)
----.editorconfig(180B)