MCPcopy Index your code
hub / github.com/TanStack/db / createMockPosts

Function createMockPosts

packages/react-db/tests/useLiveInfiniteQuery.test.tsx:18–30  ·  view source on GitHub ↗
(count: number)

Source from the content-addressed store, hash-verified

16}
17
18function createMockPosts(count: number): Array<Post> {
19 const posts: Array<Post> = []
20 for (let i = 1; i <= count; i++) {
21 posts.push({
22 id: `${i}`,
23 title: `Post ${i}`,
24 content: `Content ${i}`,
25 createdAt: 1000000 - i * 1000, // Descending order
26 category: i % 2 === 0 ? `tech` : `life`,
27 })
28 }
29 return posts
30}
31
32type OnDemandCollectionOptions = {
33 id: string

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…