MCPcopy Create free account
hub / github.com/bytebase/bytebase / getDefaultProject

Function getDefaultProject

frontend/src/react/stores/app/project.ts:83–89  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

81const defaultProjectByName = new Map<string, Project>();
82
83function getDefaultProject(name: string) {
84 const existing = defaultProjectByName.get(name);
85 if (existing) return existing;
86 const project = createDefaultProject(name);
87 defaultProjectByName.set(name, project);
88 return project;
89}
90
91export const createProjectSlice: AppSliceCreator<ProjectSlice> = (set, get) => {
92 // Immutable bulk upsert into the by-name cache.

Callers 1

createProjectSliceFunction · 0.85

Calls 3

createDefaultProjectFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected