Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Dec 28, 2018
1 parent 858d7e5 commit 1c448ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

> nano version (~ 500b) for event-emitter.
[![Build Status](https://travis-ci.org/hustcc/onfire.js.svg?branch=master)](https://travis-ci.org/hustcc/onfire.js)
[![npm](https://img.shields.io/npm/v/onfire.js.svg)](https://www.npmjs.com/package/onfire.js)


## Install
Expand All @@ -21,7 +23,7 @@ ee.on('mouseover', () => {});

ee.once('click', () => {});

ee.emit('click', 1, 'hello', true);
ee.fire('click', 1, 'hello', true);

ee.off('click');
```
Expand All @@ -35,7 +37,7 @@ Simple and similar with `event-emitter`.

- **on**(eventName: string, callback: Function): listen an event.
- **once**(eventName: string, callback: Function): listen a event only once.
- **emit**(eventName: string, ...parameters: any[]): emit / trigger an event with parameters.
- **fire**(eventName: string, ...parameters: any[]): emit / trigger an event with parameters.
- **off**(eventName?: string, callback?: Function): unsubscribe an event.


Expand Down
2 changes: 1 addition & 1 deletion __tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('OnFire', () => {
});
});

test('emit', () => {
test('fire', () => {
const ee = new EE();

const fn = jest.fn();
Expand Down

0 comments on commit 1c448ca

Please sign in to comment.