Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arbitrary-emitter

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arbitrary-emitter - npm Package Compare versions

Comparing version 0.6.1 to 0.6.2

2

arbitrary-emitter.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc