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

Function upsertInstances

frontend/src/react/stores/app/instance.ts:79–88  ·  view source on GitHub ↗
(instances: Instance[])

Source from the content-addressed store, hash-verified

77
78 // Immutable bulk upsert into the by-name cache.
79 const upsertInstances = (instances: Instance[]): Instance[] => {
80 set((state) => {
81 const instancesByName = { ...state.instancesByName };
82 for (const instance of instances) {
83 instancesByName[instance.name] = instance;
84 }
85 return { instancesByName };
86 });
87 return instances;
88 };
89
90 return {
91 instancesByName: {},

Callers 1

createInstanceSliceFunction · 0.85

Calls 1

setFunction · 0.85

Tested by

no test coverage detected