MCPcopy Index your code
hub / github.com/TanStack/query / addToEnd

Function addToEnd

packages/query-core/src/utils.ts:400–403  ·  view source on GitHub ↗
(items: Array<T>, item: T, max = 0)

Source from the content-addressed store, hash-verified

398}
399
400export function addToEnd<T>(items: Array<T>, item: T, max = 0): Array<T> {
401 const newItems = [...items, item]
402 return max && newItems.length > max ? newItems.slice(1) : newItems
403}
404
405export function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> {
406 const newItems = [item, ...items]

Callers 2

streamedQueryFunction · 0.90
utils.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…