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

eva-events

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eva-events - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

15

lib/eva.js

@@ -159,3 +159,3 @@ 'use strict'

if (this._pendings.has(UID)) {
fulfill(this, UID, new RangeError('UID overflow error. This transaction was never resolved, and its UID is needed by a newer transaction.'))
fulfill(this, UID, new RangeError('UID overflow error. This transaction was never resolved, and its UID is needed by a newer transaction.'), true)
}

@@ -296,11 +296,16 @@ this._ws.send(message)

function registerTransaction(eva, UID) {
return new Promise(function (resolve, reject) {
eva._pendings.set(UID, {resolve: resolve, reject: reject})
var fate
var promise = new Promise(function (resolve, reject) {
fate = {resolve: resolve, reject: reject, promise: null}
}).bind(eva)
fate.promise = promise
eva._pendings.set(UID, fate)
return promise
}
function fulfill(eva, response, UID) {
function fulfill(eva, response, UID, supress) {
var fate = eva._pendings.get(UID)
if (fate) {
eva._pendings.delete(UID)
supress && fate.promise.suppressUnhandledRejections()
;(response instanceof Error ? fate.reject : fate.resolve)(response)

@@ -358,3 +363,3 @@ }

eva._pendings.forEach(function (fate, UID) {
fulfill(eva, new Error('Connection was lost.'), UID)
fulfill(eva, new Error('Connection was lost.'), UID, true)
})

@@ -361,0 +366,0 @@ eva._internal.removeAllListeners()

{
"name": "eva-events",
"version": "0.2.0",
"version": "0.2.1",
"description": "Eva is like an EventEmitter, but over WebSockets.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -34,3 +34,4 @@ ![Image of Eve](http://s11.postimg.org/h1cc0m88z/eveflying.jpg)

.then(function (reply) {
console.log(reply instanceof Date) // true
reply instanceof Date // true
this === eva // true
})

@@ -37,0 +38,0 @@ })

Sorry, the diff of this file is not supported yet

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