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

Function addToStart

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

Source from the content-addressed store, hash-verified

403}
404
405export function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> {
406 const newItems = [item, ...items]
407 return max && newItems.length > max ? newItems.slice(0, -1) : newItems
408}
409
410export const skipToken = Symbol()
411export type SkipToken = typeof skipToken

Callers 1

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…