文件名称:Event.js:自定义事件实现使用纯 javascript
文件大小:1KB
文件格式:ZIP
更新时间:2024-07-06 09:54:38
JavaScript
事件.js 自定义事件实现使用纯 javascript 用法 Event.on("eventName", fn); Event.emit("eventName", [args]); Event.unsubscribe("eventName"); 例子 function handler(msg) { console.log(msg); } Event.on("data:stored", handler); Event.emit("data:stored", "Data were already stored!"); //output: "Data were already stored!"
【文件预览】:
Event.js-master
----README.md(442B)
----Event.js(779B)