Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zswang/h5emitter
event emitter function
https://github.com/zswang/h5emitter
emitter event
Last synced: about 1 month ago
JSON representation
event emitter function
- Host: GitHub
- URL: https://github.com/zswang/h5emitter
- Owner: zswang
- License: mit
- Created: 2017-05-08T09:18:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T07:09:46.000Z (about 7 years ago)
- Last Synced: 2024-09-17T00:41:53.869Z (about 2 months ago)
- Topics: emitter, event
- Language: JavaScript
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
h5emitter
-----------# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url]
emitter event function.
## Install 安装
```sh
$ npm install --save h5emitter
```## Usage 使用方法
### 绑定和触发事件 bind and trigger events
```js
var emitter = new h5emitter.Emitter()emitter.on('update', function (value) {
console.log(value)
})emitter.emit('update', 'hello')
```## License
MIT © [zswang](http://weibo.com/zswang)
[npm-url]: https://npmjs.org/package/h5emitter
[npm-image]: https://badge.fury.io/js/h5emitter.svg
[travis-url]: https://travis-ci.org/zswang/h5emitter
[travis-image]: https://travis-ci.org/zswang/h5emitter.svg?branch=master
[coverage-url]: https://coveralls.io/github/zswang/h5emitter?branch=master
[coverage-image]: https://coveralls.io/repos/zswang/h5emitter/badge.svg?branch=master&service=github