@mocanvas/editor · interface

UserStore

interface UserStore

Where the editor asks about people.

An app implements this over whatever it already has — a session, a members table, a directory — so that attribution can name the author of a shape and presence can put a face to a cursor without the editor owning any of it.


Methods · 2

getCurrentUser(): User | null

The person using this editor right now, or null when nobody is signed in.

resolve(userId: UserId): User | null | Promise<User | null>

Look up somebody by id. Returns null for an unknown id. May be async — callers must tolerate a promise, and render a placeholder until it settles.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.