8 lines · 329 B
import { env } from "cloudflare:workers";
import type { EditorRoom } from "./room";

/** The single place that knows how editor rooms are keyed: one per (repo, branch). */
export function editorRoomStub(repoId: string, branch: string): DurableObjectStub<EditorRoom> {
  return env.EDITOR_ROOM.getByName(`${repoId}:${branch}`);
}