rednib:事件绑定器

时间:2021-06-07 18:48:39
【文件属性】:
文件名称:rednib:事件绑定器
文件大小:5KB
文件格式:ZIP
更新时间:2021-06-07 18:48:39
JavaScript rednib v0.0.2 rednib 接受任何对象并使其可观察。 var pojo = { } ; rednib ( pojo ) ; var onFoo = function ( ) { console . log ( 'onFoo' ) ; } ; pojo . bind ( 'foo' , onFoo ) ; pojo . trigger ( 'foo' , onFoo ) ; // logs 'onFoo' pojo . unbind ( 'bar' , onBar ) ; // omit the handler to remove all 'bar' handlers 以下内容将添加到您的可观察对象中: 绑定(功能) 解除绑定(功能) 触发器(功能) _handlers(数组) 如果您更喜欢不同的函数名称,您可以为它们取别名。 rednib . al
【文件预览】:
rednib-master
----.jshintrc(18B)
----.gitignore(12B)
----app.js(2KB)
----package.json(810B)
----Makefile(62B)
----.travis.yml(37B)
----Gruntfile.js(475B)
----README.md(2KB)
----.npmignore(4B)
----test()
--------.jshintrc(124B)
--------app.js(5KB)

网友评论