
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
custom-event-ts
Advanced tools
[](https://travis-ci.org/boycgit/custom-event-ts) [](https://coveralls.io/
A polyfill for CustomEvents on IE8+ written in Typescript
CustomEvent
when usingGlobalEvent
for easy use一旦引用该组件,就会自动对 CustomEvent
进行 polyfill,同时提供组件 GlobalEvent
对象(默认导出)方便在全局进行自定义事件的订阅
npm install custom-event-ts --save
import GlobalEvent from "custom-event-ts";
// or
var GlobalEvent = require('custom-event-ts');
// Listen event 'SAY_HELLO'
GlobalEvent.on('SAY_HELLO', (data) => {
console.log(data.detail) // { name: 'John' }
})
// Dispatch event 'SAY_HELLO' with data
GlobalEvent.dispatch('SAY_HELLO', { name: 'John' })
// Remove event listener
GlobalEvent.off('SAY_HELLO')
在页面中可以直接使用打包好的文件:
<script src="./dist/index.umd.min.js"></script>
通过 window.GlobaEvent
获取功能对象。
npm run build
npm test
npm run doc
then open the generated out/index.html
file in your browser.
MIT.
FAQs
[](https://travis-ci.org/boycgit/custom-event-ts) [](https://coveralls.io/
We found that custom-event-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.