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

Function upsertProjects

frontend/src/react/stores/app/project.ts:93–101  ·  view source on GitHub ↗
(projects: Project[])

Source from the content-addressed store, hash-verified

91export const createProjectSlice: AppSliceCreator<ProjectSlice> = (set, get) => {
92 // Immutable bulk upsert into the by-name cache.
93 const upsertProjects = (projects: Project[]): void => {
94 set((state) => {
95 const next = { ...state.projectsByName };
96 for (const project of projects) {
97 next[project.name] = project;
98 }
99 return { projectsByName: next };
100 });
101 };
102
103 const slice: ProjectSlice = {
104 projectsByName: {},

Callers 1

createProjectSliceFunction · 0.85

Calls 1

setFunction · 0.85

Tested by

no test coverage detected