Reformated file
This commit is contained in:
parent
4a8a614adb
commit
c9c070c497
@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
// MIT License
|
// MIT License
|
||||||
|
|
||||||
import {Schedule} from './schedule.js';
|
import { Schedule } from './schedule.js';
|
||||||
import {EventHandler} from "./event-handler.js";
|
import { EventHandler } from "./event-handler.js";
|
||||||
import {Socket} from "./socket.js";
|
import { Socket } from "./socket.js";
|
||||||
|
|
||||||
export class RESTClient {
|
export class RESTClient {
|
||||||
debug = false;
|
debug = false;
|
||||||
@ -25,7 +25,7 @@ export class RESTClient {
|
|||||||
});
|
});
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.debug({url, params, result});
|
console.debug({ url, params, result });
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ export class RESTClient {
|
|||||||
|
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
if (this.debug) {
|
if (this.debug) {
|
||||||
console.debug({url, data, result});
|
console.debug({ url, data, result });
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ export class Chat extends EventHandler {
|
|||||||
call(method, ...args) {
|
call(method, ...args) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const command = {method, args, message_id: this.generateUniqueId()};
|
const command = { method, args, message_id: this.generateUniqueId() };
|
||||||
this._promises[command.message_id] = resolve;
|
this._promises[command.message_id] = resolve;
|
||||||
this._socket.send(JSON.stringify(command));
|
this._socket.send(JSON.stringify(command));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user