apollo-link-webextensions-messaging
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -97,4 +97,14 @@ "use strict"; | ||
return function () { | ||
port.postMessage(rpcs_1.operationUnsubscribeRPC(operationId)); | ||
port.onMessage.removeListener(onMessageListener); | ||
/** | ||
* In some cases like remote disconnection, port cleaning | ||
* will be unavailable. We catch error theses errors and warn | ||
* instead of propagating errors | ||
*/ | ||
try { | ||
port.postMessage(rpcs_1.operationUnsubscribeRPC(operationId)); | ||
port.onMessage.removeListener(onMessageListener); | ||
} | ||
catch (e) { | ||
console.warn(e); | ||
} | ||
}; | ||
@@ -101,0 +111,0 @@ }); |
{ | ||
"name": "apollo-link-webextensions-messaging", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -38,3 +38,3 @@ import { ApolloLink, GraphQLRequest, execute, Observable } from 'apollo-link'; | ||
{ link }: CreateWebExtensionMessagingExecutorListenerOptions | ||
): ((port: T) => void) { | ||
): ((port: T) => void) { | ||
return (port: T): void => { | ||
@@ -120,4 +120,13 @@ port.onMessage.addListener(message => { | ||
return (): void => { | ||
port.postMessage(operationUnsubscribeRPC(operationId)); | ||
port.onMessage.removeListener(onMessageListener); | ||
/** | ||
* In some cases like remote disconnection, port cleaning | ||
* will be unavailable. We catch error theses errors and warn | ||
* instead of propagating errors | ||
*/ | ||
try { | ||
port.postMessage(operationUnsubscribeRPC(operationId)); | ||
port.onMessage.removeListener(onMessageListener); | ||
} catch (e) { | ||
console.warn(e); | ||
} | ||
}; | ||
@@ -124,0 +133,0 @@ }); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
44445
1052
1