MCPcopy Create free account
hub / github.com/atomicdata-dev/atomic-data-browser / setElement

Function setElement

data-browser/src/views/DocumentPage.tsx:228–236  ·  view source on GitHub ↗

Sets the subject for a specific element and moves to the next element

(index: number, subject: string)

Source from the content-addressed store, hash-verified

226
227 /** Sets the subject for a specific element and moves to the next element */
228 async function setElement(index: number, subject: string) {
229 elements[index] = subject;
230 setElements(elements);
231 if (index == elements.length - 1) {
232 addElement(index + 1);
233 } else {
234 focusElement(index + 1);
235 }
236 }
237
238 function moveElement(from: number, to: number) {
239 const element = elements[from];

Callers 2

ElementEditFunction · 0.85
SearchWidgetFunction · 0.85

Calls 2

addElementFunction · 0.85
focusElementFunction · 0.85

Tested by

no test coverage detected