Skip to content

Interface: CommentsStore

@roomful/svelte


@roomful/svelte / CommentsStore

Defined in: packages/svelte/src/index.ts:451

Readable store of collaborative comment threads augmented with the thread mutators.

add: (input) => Promise<CommentThread>

Defined in: packages/svelte/src/index.ts:455

Opens a new thread authored by the local peer at an anchor.

Opens a new thread authored by the local peer at anchor. The thread id and createdAt are generated.

The thread anchor and root comment body.

CommentAnchor

string

Promise<CommentThread>

A promise resolving to the created thread.


getByElement: (elementId) => CommentThread[]

Defined in: packages/svelte/src/index.ts:485

Returns the threads anchored to an element.

Returns the threads anchored to elementId (element or text-range anchors).

string

The element id to filter by.

CommentThread[]

The matching threads.


getOpen: () => CommentThread[]

Defined in: packages/svelte/src/index.ts:490

Returns the unresolved threads.

Returns the unresolved threads.

CommentThread[]

The open threads.

reopen(threadId): Promise<CommentThread>

Defined in: packages/svelte/src/index.ts:480

Reopens a resolved thread.

string

The thread to reopen.

Promise<CommentThread>

A promise resolving to the updated thread.


reply(threadId, text): Promise<CommentThread>

Defined in: packages/svelte/src/index.ts:464

Appends a reply authored by the local peer to a thread.

string

The thread to reply to.

string

The reply body.

Promise<CommentThread>

A promise resolving to the updated thread.


resolve(threadId): Promise<CommentThread>

Defined in: packages/svelte/src/index.ts:472

Marks a thread resolved.

string

The thread to resolve.

Promise<CommentThread>

A promise resolving to the updated thread.


subscribe(this, run, invalidate?): Unsubscriber

Defined in: node_modules/.pnpm/svelte@4.2.20/node_modules/svelte/types/index.d.ts:1619

Subscribe on value changes.

void

Subscriber<CommentThread[]>

subscription callback

Invalidator<CommentThread[]>

cleanup callback

Unsubscriber

Readable.subscribe