WS: use dot notation for JS properties

This commit is contained in:
Luciano Iam 2020-06-14 11:41:50 +02:00 committed by Robin Gareus
parent 49352d0732
commit cc8ed1580c
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -45,7 +45,7 @@ export class ArdourClient {
set handlers (handlers) { set handlers (handlers) {
this._handlers = handlers || {}; this._handlers = handlers || {};
this._channel.onError = this._handlers['onError'] || console.log; this._channel.onError = this._handlers.onError || console.log;
} }
// Access to the object-oriented API (enabled by default) // Access to the object-oriented API (enabled by default)
@ -133,14 +133,14 @@ export class ArdourClient {
_setConnected (connected) { _setConnected (connected) {
this._connected = connected; this._connected = connected;
if (this._handlers['onConnected']) { if (this._handlers.onConnected) {
this._handlers['onConnected'](this._connected); this._handlers.onConnected(this._connected);
} }
} }
_handleMessage (msg, inbound) { _handleMessage (msg, inbound) {
if (this._handlers['onMessage']) { if (this._handlers.onMessage) {
this._handlers['onMessage'](msg, inbound); this._handlers.onMessage(msg, inbound);
} }
if (inbound) { if (inbound) {