Socket
Socket
Sign inDemoInstall

nanoevents

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoevents - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 1.0.7
* Reduce size (by Vladlen Grachev).
## 1.0.6

@@ -5,0 +8,0 @@ * Fix docs.

49

index.js

@@ -38,2 +38,27 @@ (

/**
* Calls each of the listeners registered for a given event.
*
* @param {string} event The event name.
* @param {...*} arguments The arguments for listeners.
*
* @return {undefined}
*
* @example
* ee.emit('tick', tickType, tickDuration)
*
* @alias NanoEvents#emit
* @method
*/
emit: function emit (event) {
// event variable is reused and repurposed, now it's an array of handlers
event = this.events[event]
if (!event || !event[0]) return // event[0] === Array.isArray(event)
var args = event.slice.call(arguments, 1)
event.slice().map(function (i) {
i.apply(this, args) // this === global or window
})
},
/**
* Add a listener for a given event.

@@ -72,27 +97,3 @@ *

}
},
/**
* Calls each of the listeners registered for a given event.
*
* @param {string} event The event name.
* @param {...*} arguments The arguments for listeners.
*
* @return {undefined}
*
* @example
* ee.emit('tick', tickType, tickDuration)
*
* @alias NanoEvents#emit
* @method
*/
emit: function emit (event) {
var list = this.events[event]
if (!list || !list[0]) return // list[0] === Array.isArray(list)
var args = list.slice.call(arguments, 1)
list.slice().map(function (i) {
i.apply(this, args) // this === global or window
})
}
}
{
"name": "nanoevents",
"version": "1.0.6",
"description": "Simple and tiny (118 bytes) event emitter library",
"version": "1.0.7",
"description": "Simple and tiny (115 bytes) event emitter library",
"keywords": [

@@ -6,0 +6,0 @@ "EventEmitter",

@@ -6,3 +6,3 @@ # Nano Events

* No Node.js [EventEmitter] compatibility.
* Only 118 bytes (minified and gzipped). It uses [Size Limit] to control size.
* Only 115 bytes (minified and gzipped). It uses [Size Limit] to control size.
* `on` method returns `unbind` function. You don’t need to save

@@ -9,0 +9,0 @@ callback to variable for `removeListener`.

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