arbitrary-emitter
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -32,4 +32,4 @@ 'use strict' | ||
function fn () { | ||
rm() | ||
method(arguments) | ||
rm() | ||
} | ||
@@ -36,0 +36,0 @@ }, |
{ | ||
"name": "arbitrary-emitter", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Event emitter with Map/Set sugar", | ||
@@ -5,0 +5,0 @@ "main": "arbitrary-emitter.js", |
@@ -6,2 +6,4 @@ arbitrary-emitter | ||
[![Build Status](https://travis-ci.org/jacoborus/arbitrary-emitter.svg?branch=master)](https://travis-ci.org/jacoborus/arbitrary-emitter) | ||
**arbitrary-emitter** allows to use arbitrary values as keys for your events | ||
@@ -25,10 +27,8 @@ | ||
- [emitter.off](#emitter-off-api) | ||
- [Testing](#testing) | ||
<a name="emitter-on-api"></a> | ||
### on(key, method) | ||
### on(key, action) | ||
Add a listener for `key` which will trigger `method` function. | ||
Add a listener with `key` which will trigger `action` function. | ||
`key` can be any type of value. | ||
@@ -40,5 +40,5 @@ | ||
const obj = {} | ||
let unsubscribe = emitter.on(obj, () => doSomething()) | ||
let removeListener = emitter.on(obj, () => doSomething()) | ||
emitter.emit(obj) // will `doSomething` | ||
unsubscribe() | ||
removeListener() | ||
emitter.emit(obj) // won't do anything | ||
@@ -50,5 +50,5 @@ ``` | ||
<a name="emitter-addonce-api"></a> | ||
### once(key, method) | ||
### once(key, action) | ||
Add a listener for `key` which will trigger `method` function just one time, then listener will be removed. | ||
Add a listener for `key` which will trigger `action` function just one time, then listener will be removed. | ||
`key` can be any type of value | ||
@@ -68,3 +68,3 @@ | ||
emit methods binded to `key`, and pass the rest of arguments to it | ||
`emit` methods binded to `key`, and pass the rest of the arguments to it | ||
@@ -100,4 +100,2 @@ ```js | ||
[![Build Status](https://travis-ci.org/jacoborus/arbitrary-emitter.svg?branch=master)](https://travis-ci.org/jacoborus/arbitrary-emitter) | ||
<br><br> | ||
@@ -104,0 +102,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7070
100