This commit is contained in:
Philipp Heckel 2022-03-04 16:10:04 -05:00
parent e7bd3abadc
commit b5670d9a71
9 changed files with 149 additions and 106 deletions

View file

@ -3,7 +3,6 @@ import {sha256} from "./utils";
class ConnectionManager {
constructor() {
console.log(`connection manager`)
this.connections = new Map(); // ConnectionId -> Connection (hash, see below)
this.stateListener = null; // Fired when connection state changes
this.notificationListener = null; // Fired when new notifications arrive

View file

@ -114,6 +114,10 @@ export const openUrl = (url) => {
window.open(url, "_blank", "noopener,noreferrer");
};
export const subscriptionRoute = (subscription) => {
return `/${subscription.topic}`;
}
// From: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
export async function* fetchLinesIterator(fileURL, headers) {
const utf8Decoder = new TextDecoder('utf-8');