Skip to content

Commit

Permalink
Copy docstring from the Table's sync method to the extracted sync method
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-dp committed Jun 20, 2024
1 parent 1badd76 commit 166fae3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions clients/typescript/src/client/model/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ export class ElectricClient<
DB extends DbSchema<any>
> extends ElectricNamespace {
public sync: Omit<IShapeManager, 'subscribe'> & {
/**
* Subscribes to the given shape, returnig a {@link ShapeSubscription} object which
* can be used to wait for the shape to sync initial data.
*
* NOTE: If you establish a shape subscription that has already synced its initial data,
* awaiting `shape.synced` will always resolve immediately as shape subscriptions are persisted.
* i.e.: imagine that you re-sync the same shape during subsequent application loads.
* Awaiting `shape.synced` a second time will only ensure that the initial
* shape load is complete. It does not ensure that the replication stream
* has caught up to the central DB's more recent state.
*
* @param i - The shape to subscribe to
* @param key - An optional unique key that identifies the subscription
* @returns A shape subscription
*/
subscribe: (
i: ShapeInputWithTable,
key?: string
Expand Down

0 comments on commit 166fae3

Please sign in to comment.