Workaround for circular connect (#73)
* Workaround for circular connect * Upgrade dependencies
This commit is contained in:
@@ -34,9 +34,9 @@
|
||||
"nock": "^9.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/util": "^0.19.1",
|
||||
"@polkadot/util-crypto": "^0.19.1",
|
||||
"@polkadot/util-keyring": "^0.19.1",
|
||||
"@polkadot/util": "^0.19.2",
|
||||
"@polkadot/util-crypto": "^0.19.2",
|
||||
"@polkadot/util-keyring": "^0.19.2",
|
||||
"babel-runtime": "^6.26.0",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
"websocket": "^1.0.25"
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
import type { WsState } from './types';
|
||||
|
||||
const connect = require('./connect');
|
||||
|
||||
module.exports = function onClose (self: WsState): () => void {
|
||||
return (): void => {
|
||||
self.l.debug(() => ['disconnected from', self.endpoint]);
|
||||
@@ -14,7 +12,10 @@ module.exports = function onClose (self: WsState): () => void {
|
||||
self.isConnected = false;
|
||||
|
||||
if (self.autoConnect) {
|
||||
setTimeout(() => connect(self), 1000);
|
||||
setTimeout(() => {
|
||||
// FIXME: This is a circular dependency
|
||||
require('./connect')(self);
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user