Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const errors = err && (Array.isArray(err) ? err : [err]);
if (errors && errors.length > 0) {
typeof onDisconnected === 'function' && onDisconnected(errors);
} else {
typeof onConnected === 'function' && onConnected();
}
},
});
const forwardSubscription = operation => subscriptionClient.request(operation);
return new Client({
url,
fetchOptions: config.default || {},
exchanges: [
...defaultExchanges,
subscriptionExchange({
forwardSubscription,
}),
],
});
}