iconnectivity-js
Advanced tools
Comparing version 1.1.4 to 1.1.5
@@ -13,3 +13,3 @@ /// <reference types="lodash" /> | ||
readonly midiAccess: MIDIAccess; | ||
private devices; | ||
private _devices; | ||
readonly devicesChanged: { | ||
@@ -22,2 +22,3 @@ addListener: (listener: (devices: Device[]) => void) => () => void; | ||
destroy(): void; | ||
get devices(): readonly Device[]; | ||
get product(): Product | undefined; | ||
@@ -24,0 +25,0 @@ set product(product: Product | undefined); |
@@ -39,8 +39,8 @@ "use strict"; | ||
this.midiAccess = midiAccess; | ||
this.devices = []; | ||
this._devices = []; | ||
this.devicesChanged = (0, event_source_1.createEventSource)(); | ||
this.handleMidiStateChange = (0, debounce_1.default)(async () => { | ||
const devices = await this.getDevices(); | ||
if (!(0, isEqual_1.default)(devices.map((d) => d.serialNumber), this.devices.map((d) => d.serialNumber))) { | ||
this.devices = devices; | ||
if (!(0, isEqual_1.default)(devices.map((d) => d.serialNumber), this._devices.map((d) => d.serialNumber))) { | ||
this._devices = devices; | ||
this.devicesChanged.emit(devices); | ||
@@ -56,2 +56,5 @@ } | ||
} | ||
get devices() { | ||
return this._devices; | ||
} | ||
get product() { | ||
@@ -96,4 +99,4 @@ return this._product; | ||
async waitForDevices() { | ||
if (this.devices.length) { | ||
return this.devices; | ||
if (this._devices.length) { | ||
return this._devices; | ||
} | ||
@@ -100,0 +103,0 @@ else { |
{ | ||
"name": "iconnectivity-js", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"main": "lib/index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
81056
1737