@dwmt/comlink
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -249,3 +249,3 @@ import { inherits } from 'util'; | ||
class Client { | ||
constructor() { | ||
constructor(options = {}) { | ||
this._axios = axios; | ||
@@ -260,2 +260,4 @@ this._ws = WebSocket; | ||
this._defaultDialect = null; | ||
this._instanceID = generateUUID(); | ||
this._devtools = options.devtools || true; | ||
} | ||
@@ -268,2 +270,17 @@ | ||
disableDevtools() { | ||
this._devtools = false; | ||
} | ||
bindDevtools() { | ||
if (global.window) { | ||
if (!global.window._COMLINK_DEV_TOOLS) { | ||
global.window._COMLINK_DEV_TOOLS = {}; | ||
} | ||
global.window._COMLINK_DEV_TOOLS[this._instanceID] = this; | ||
console.log('[COMLINK] Devtools enabled with instanceID: ' + this._instanceID); | ||
} | ||
} | ||
async connect() { | ||
@@ -612,3 +629,3 @@ let connecting = []; | ||
} else { | ||
return this._rpc('request', path, data, options, _dialect); | ||
return await this._rpc('request', path, data, options, _dialect); | ||
} | ||
@@ -636,3 +653,3 @@ } catch (err) { | ||
} else { | ||
return this._rpc('inform', path, data, options, _dialect); | ||
return await this._rpc('inform', path, data, options, _dialect); | ||
} | ||
@@ -834,3 +851,3 @@ } catch (err) { | ||
var version = "1.1.4"; | ||
var version = "1.1.5"; | ||
@@ -837,0 +854,0 @@ var Comlink = { |
@@ -253,3 +253,3 @@ 'use strict'; | ||
class Client { | ||
constructor() { | ||
constructor(options = {}) { | ||
this._axios = axios; | ||
@@ -264,2 +264,4 @@ this._ws = WebSocket; | ||
this._defaultDialect = null; | ||
this._instanceID = generateUUID(); | ||
this._devtools = options.devtools || true; | ||
} | ||
@@ -272,2 +274,17 @@ | ||
disableDevtools() { | ||
this._devtools = false; | ||
} | ||
bindDevtools() { | ||
if (global.window) { | ||
if (!global.window._COMLINK_DEV_TOOLS) { | ||
global.window._COMLINK_DEV_TOOLS = {}; | ||
} | ||
global.window._COMLINK_DEV_TOOLS[this._instanceID] = this; | ||
console.log('[COMLINK] Devtools enabled with instanceID: ' + this._instanceID); | ||
} | ||
} | ||
async connect() { | ||
@@ -616,3 +633,3 @@ let connecting = []; | ||
} else { | ||
return this._rpc('request', path, data, options, _dialect); | ||
return await this._rpc('request', path, data, options, _dialect); | ||
} | ||
@@ -640,3 +657,3 @@ } catch (err) { | ||
} else { | ||
return this._rpc('inform', path, data, options, _dialect); | ||
return await this._rpc('inform', path, data, options, _dialect); | ||
} | ||
@@ -838,3 +855,3 @@ } catch (err) { | ||
var version = "1.1.4"; | ||
var version = "1.1.5"; | ||
@@ -841,0 +858,0 @@ var Comlink = { |
{ | ||
"name": "@dwmt/comlink", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "Communication library for lazy enthusiasts", | ||
@@ -71,20 +71,20 @@ "main": "dist/Comlink.js", | ||
"sinon": "^9.0.2" | ||
}, | ||
"babel": { | ||
"plugins": [ | ||
[ | ||
"dynamic-import-node" | ||
] | ||
], | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
] | ||
} | ||
}, | ||
"babel": { | ||
"plugins": [ | ||
[ | ||
"dynamic-import-node" | ||
] | ||
], | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53260
1554