mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-07 22:35:48 +00:00
Compare commits
3 Commits
patch-rena
...
nn/blitz
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e9c922e41 | ||
|
|
e71123ad9d | ||
|
|
248445acd9 |
@@ -84,7 +84,7 @@
|
|||||||
"watch": "run-s build:lib --watch",
|
"watch": "run-s build:lib --watch",
|
||||||
"clean": "rm -rf dist",
|
"clean": "rm -rf dist",
|
||||||
"docgen": "typedoc ./src/index.ts",
|
"docgen": "typedoc ./src/index.ts",
|
||||||
"prepublish": "run-s clean build",
|
"prepublish": "npm run clean && npm run build",
|
||||||
"test": "nyc mocha --config=test/.mocharc.json --exit",
|
"test": "nyc mocha --config=test/.mocharc.json --exit",
|
||||||
"test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/**/*.ts ./test/integration/*.ts",
|
"test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/**/*.ts ./test/integration/*.ts",
|
||||||
"test:browser": "npm run build:browserTests && TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/browser/*.ts",
|
"test:browser": "npm run build:browserTests && TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/browser/*.ts",
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ export class Connection extends EventEmitter {
|
|||||||
* @throws ConnectionError if there is a connection error, RippleError if there is already a WebSocket in existence.
|
* @throws ConnectionError if there is a connection error, RippleError if there is already a WebSocket in existence.
|
||||||
*/
|
*/
|
||||||
public async connect(): Promise<void> {
|
public async connect(): Promise<void> {
|
||||||
|
console.log('CONNECTING IN CONNECTION.CONNECT')
|
||||||
if (this.isConnected()) {
|
if (this.isConnected()) {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
}
|
}
|
||||||
@@ -325,6 +326,7 @@ export class Connection extends EventEmitter {
|
|||||||
if (!this.shouldBeConnected || this.ws == null) {
|
if (!this.shouldBeConnected || this.ws == null) {
|
||||||
throw new NotConnectedError()
|
throw new NotConnectedError()
|
||||||
}
|
}
|
||||||
|
|
||||||
const [id, message, responsePromise] = this.requestManager.createRequest(
|
const [id, message, responsePromise] = this.requestManager.createRequest(
|
||||||
request,
|
request,
|
||||||
timeout ?? this.config.timeout,
|
timeout ?? this.config.timeout,
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ class Client extends EventEmitter {
|
|||||||
// eslint-disable-next-line max-lines-per-function -- okay because we have to set up all the connection handlers
|
// eslint-disable-next-line max-lines-per-function -- okay because we have to set up all the connection handlers
|
||||||
public constructor(server: string, options: ClientOptions = {}) {
|
public constructor(server: string, options: ClientOptions = {}) {
|
||||||
super()
|
super()
|
||||||
|
console.log('CONSTRUCTING CLIENT')
|
||||||
|
|
||||||
if (typeof server !== 'string' || !/wss?(?:\+unix)?:\/\//u.exec(server)) {
|
if (typeof server !== 'string' || !/wss?(?:\+unix)?:\/\//u.exec(server)) {
|
||||||
throw new ValidationError(
|
throw new ValidationError(
|
||||||
'server URI must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.',
|
'server URI must start with `wss://`, `ws://`, `wss+unix://`, or `ws+unix://`.',
|
||||||
@@ -500,6 +502,8 @@ class Client extends EventEmitter {
|
|||||||
* @returns A promise that resolves with a void value when a connection is established.
|
* @returns A promise that resolves with a void value when a connection is established.
|
||||||
*/
|
*/
|
||||||
public async connect(): Promise<void> {
|
public async connect(): Promise<void> {
|
||||||
|
console.log('CONNECTING IN CLIENT.CONNECT')
|
||||||
|
|
||||||
return this.connection.connect()
|
return this.connection.connect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user