MCPcopy Create free account
hub / github.com/adobe/react-spectrum / append

Function append

packages/react-stately/src/data/useTreeData.ts:339–350  ·  view source on GitHub ↗
(parentKey: Key | null, ...values: T[])

Source from the content-addressed store, hash-verified

337 this.insert(parentKey, 0, ...values);
338 },
339 append(parentKey: Key | null, ...values: T[]) {
340 if (parentKey == null) {
341 this.insert(null, items.length, ...values);
342 } else {
343 let parentNode = nodeMap.get(parentKey);
344 if (!parentNode) {
345 return;
346 }
347
348 this.insert(parentKey, parentNode.children!.length, ...values);
349 }
350 },
351 remove(...keys: Key[]) {
352 if (keys.length === 0) {
353 return;

Callers

nothing calls this directly

Calls 1

insertMethod · 0.65

Tested by

no test coverage detected