【文件属性】:
文件名称:EventBusJS:用ES2015编写的简单但功能强大的事件总线
文件大小:32KB
文件格式:ZIP
更新时间:2021-05-14 14:45:43
js es2015 event-bus JavaScript
EventBusJS
用ES2015编写的简单但功能强大的事件总线
安装
推荐的最合适的安装方式是通过Yarn :
$ yarn add lin3s-event-bus
或者通过NPM :
$ npm install --save lin3s-event-bus
基本用法
// your-dom-js-file.js
import { onDomReady , onDomLoaded , onWindowResized } from 'lin3s-event-bus' ;
const onReady = ( domReadyEvent ) => {
console . log ( 'DOM is ready!' ) ;
} ;
const onLoaded = ( domLoadedEvent ) => {
console . log ( 'window is loaded!'
【文件预览】:
EventBusJS-master
----.travis.yml(569B)
----package.json(1KB)
----test()
--------DOMReadyEventSubscriberTest.js(1KB)
--------EventTypesTest.js(595B)
--------DOMLoadedEventTest.js(585B)
--------DomReadyEventTest.js(577B)
--------DOMLoadedEventSubscriberTest.js(1KB)
--------WindowResizedEventSubscriberTest.js(1KB)
--------EventTest.js(538B)
--------WindowResizedEventTest.js(615B)
--------PriorityQueue.js(867B)
--------PriorityTest.js(676B)
----LICENSE(1KB)
----src()
--------Dom()
--------Core()
--------index.js(2KB)
--------Subscribers()
--------Subscriptions()
--------Publishers()
--------Events()
----webpack.config.babel.js(773B)
----.gitignore(379B)
----CHANGELOG.md(2KB)
----README.md(8KB)
----.editorconfig(463B)