MCPcopy Create free account
hub / github.com/TanStack/query / addToStart

Function addToStart

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

Source from the content-addressed store, hash-verified

436}
437
438export function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> {
439 const newItems = [item, ...items]
440 return max && newItems.length > max ? newItems.slice(0, -1) : newItems
441}
442
443export const skipToken = Symbol()
444export type SkipToken = typeof skipToken

Callers 1

utils.test.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected