Skip to content

Comments: Make getThreads async #1977

@AntoLC

Description

@AntoLC

Problem

getThreads is necessary to load the "Threads" but the interface does not accept Promise response, so it does not seem easy to include this part with REST:

abstract getThread(threadId: string): ThreadData;


A REST example implementation is provided but it does not include the getThreads part:
https://github.com/TypeCellOS/BlockNote/blob/ac322a1aa38fd48e64afdf7cfaebb10a6b77c364/packages/core/src/comments/threadstore/yjs/RESTYjsThreadStore.ts

Based on that:

public getThreads(): Map<string, ThreadData> {
const threadMap = new Map<string, ThreadData>();
this.threadsYMap.forEach((yThread, id) => {
threadMap.set(id, yMapToThread(yThread));
});
return threadMap;
}

Request

Could we change the interface to accept promise response with getThreads ?

Thx!

Bonus

  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions