MCPcopy
hub / github.com/drawdb-io/drawdb / updateType

Function updateType

src/context/TypesContext.jsx:97–105  ·  view source on GitHub ↗
(id, values)

Source from the content-addressed store, hash-verified

95 };
96
97 const updateType = (id, values) => {
98 setTypes((prev) =>
99 prev.map((item, index) => {
100 const isMatch = typeof id === "number" ? index === id : item.id === id;
101
102 return isMatch ? { ...item, ...values } : item;
103 }),
104 );
105 };
106
107 return (
108 <TypesContext.Provider

Callers 4

undoFunction · 0.85
redoFunction · 0.85
TypeInfoFunction · 0.85
TypeFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected