Skip to content

Commit

Permalink
Rename connectFork to connect
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Sep 20, 2024
1 parent 01cc533 commit e7f9a74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions javascript/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ export interface IDocumentProvider extends IDisposable {
fork(): Promise<string>;

/**
* Connect the shared document to a forked room with forkId (disconnect from previous room).
* Connect the shared document to a room with given ID (disconnect from previous room).
*/
connectFork(forkId: string): void;
connect(roomId: string): void;
}

/**
Expand Down
9 changes: 7 additions & 2 deletions javascript/src/ydocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import { JSONExt, JSONObject, JSONValue } from '@lumino/coreutils';
import { ISignal, Signal } from '@lumino/signaling';
import { Awareness } from 'y-protocols/awareness';
import * as Y from 'yjs';
import type { DocumentChange, IDocumentProvider, ISharedDocument, StateChange } from './api';
import type {
DocumentChange,
IDocumentProvider,
ISharedDocument,
StateChange
} from './api.js';

/**
* Generic shareable document.
Expand All @@ -18,7 +23,7 @@ export abstract class YDocument<T extends DocumentChange>
constructor(options?: YDocument.IOptions) {
this._ydoc = options?.ydoc ?? new Y.Doc();
this.rootRoomId = options?.rootRoomId ?? '';
this.currentRoomId = options?.currentRoomId ?? ''
this.currentRoomId = options?.currentRoomId ?? '';

this._ystate = this._ydoc.getMap('state');

Expand Down

0 comments on commit e7f9a74

Please sign in to comment.