@ledgerhq/hw-transport-http
Advanced tools
Comparing version 1.2.0-beta.5f7fbb68 to 1.2.0-beta.7172f590
@@ -84,5 +84,5 @@ "use strict"; | ||
HttpTransport.discover = _observer => ({ | ||
HttpTransport.listen = _observer => ({ | ||
unsubscribe: () => {} | ||
}); | ||
//# sourceMappingURL=HttpTransport.js.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
exports.default = url => { | ||
if (!url) return _HttpTransport2.default; // by default, HttpTransport don't yield anything in list/discover | ||
if (!url) return _HttpTransport2.default; // by default, HttpTransport don't yield anything in list/listen | ||
class StaticHttpTransport extends _HttpTransport2.default {} | ||
@@ -20,3 +20,3 @@ | ||
StaticHttpTransport.discover = observer => { | ||
StaticHttpTransport.listen = observer => { | ||
let unsubscribed = false; | ||
@@ -28,3 +28,3 @@ | ||
if (unsubscribed) return; | ||
observer.next(url); | ||
observer.next({ descriptor: url, type: "add" }); | ||
observer.complete(); | ||
@@ -31,0 +31,0 @@ }, () => { |
{ | ||
"name": "@ledgerhq/hw-transport-http", | ||
"version": "1.2.0-beta.5f7fbb68", | ||
"version": "1.2.0-beta.7172f590", | ||
"description": "Ledger Hardware Wallet communication layer over http", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@ledgerhq/hw-transport": "^1.2.0-beta.5f7fbb68" | ||
"@ledgerhq/hw-transport": "^1.2.0-beta.7172f590" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
@@ -13,3 +13,3 @@ //@flow | ||
static list = (): * => Promise.resolve([]); | ||
static discover = (_observer: *) => ({ | ||
static listen = (_observer: *) => ({ | ||
unsubscribe: () => {} | ||
@@ -16,0 +16,0 @@ }); |
import HttpTransport from "./HttpTransport"; | ||
export default (url: ?string) => { | ||
if (!url) return HttpTransport; // by default, HttpTransport don't yield anything in list/discover | ||
if (!url) return HttpTransport; // by default, HttpTransport don't yield anything in list/listen | ||
class StaticHttpTransport extends HttpTransport { | ||
static list = (): * => HttpTransport.open(url).then(() => [url], () => []); | ||
static discover = (observer: *) => { | ||
static listen = (observer: *) => { | ||
let unsubscribed = false; | ||
@@ -14,3 +14,3 @@ | ||
if (unsubscribed) return; | ||
observer.next(url); | ||
observer.next({ descriptor: url, type: "add" }); | ||
observer.complete(); | ||
@@ -17,0 +17,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
23536