Skip to content

Commit

Permalink
remove alias
Browse files Browse the repository at this point in the history
  • Loading branch information
deathg0d committed Feb 19, 2024
1 parent c049c4a commit 64f5394
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@firebase/firestore";
import { collection } from "firebase/firestore";
import * as Y from "yjs";
import { ObservableV2 as Observable } from "lib0/observable";
import { ObservableV2 } from "lib0/observable";
import * as awarenessProtocol from "y-protocols/awareness";
import { deleteInstance, initiateInstance, refreshPeers } from "./utils";
import { WebRtc } from "./webrtc";
Expand Down Expand Up @@ -44,7 +44,7 @@ interface PeersRTC {
* @param maxWaitTime maximum miliseconds to wait before sending updates to peers
* @param maxWaitFirestoreTime miliseconds to wait before syncing this client's update to firestore
*/
export class FireProvider extends Observable<any> {
export class FireProvider extends ObservableV2<any> {
readonly doc: Y.Doc;
awareness: awarenessProtocol.Awareness;
readonly documentPath: string;
Expand Down Expand Up @@ -72,7 +72,7 @@ export class FireProvider extends Observable<any> {

firebaseDataLastUpdatedAt: number = new Date().getTime();

instanceConnection: Observable<any> = new Observable();
instanceConnection: ObservableV2<any> = new ObservableV2();
recreateTimeout: string | number | NodeJS.Timeout;

private unsubscribeData?: Unsubscribe;
Expand Down
12 changes: 6 additions & 6 deletions src/webrtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DocumentData,
DocumentReference,
} from "@firebase/firestore";
import { ObservableV2 as Observable } from "lib0/observable";
import { ObservableV2 } from "lib0/observable";
import SimplePeer from "simple-peer-light";
import {
Uint8ArrayToBase64,
Expand All @@ -27,7 +27,7 @@ interface Parameters {
firebaseApp: FirebaseApp;
ydoc: Y.Doc;
awareness: awarenessProtocol.Awareness;
instanceConnection: Observable<any>;
instanceConnection: ObservableV2<any>;
documentPath: string;
uid: string;
peerUid: string;
Expand All @@ -38,10 +38,10 @@ interface Object {
[key: string]: any;
}

export class WebRtc extends Observable<any> {
export class WebRtc extends ObservableV2<any> {
readonly doc: Y.Doc;
awareness: awarenessProtocol.Awareness;
instanceConnection: Observable<any>;
instanceConnection: ObservableV2<any>;
readonly documentPath: string;
uid: string;
peerUid: string;
Expand Down Expand Up @@ -313,12 +313,12 @@ export class WebRtc extends Observable<any> {
this.consoleHandler("Error", error);
};

destroy = async () => {
async destroy() {
// this.consoleHandler("destroyed");
if (this.clock) clearTimeout(this.clock);
if (this.peer) this.peer.destroy();
this.unsubHandshake();
this.deleteSignals(); // Delete calls and answers
super.destroy();
};
}
}

0 comments on commit 64f5394

Please sign in to comment.