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 Mar 19, 2024
1 parent ef97680 commit f053285
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 @@ -95,9 +95,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 f053285

Please sign in to comment.