MCPcopy
hub / github.com/TanStack/query / getContacts

Function getContacts

examples/react/react-router/src/contacts.ts:39–47  ·  view source on GitHub ↗
(query?: string)

Source from the content-addressed store, hash-verified

37seed()
38
39export async function getContacts(query?: string) {
40 await fakeNetwork()
41 let contacts = await localforage.getItem<Contact[]>('contacts')
42 if (!contacts) contacts = []
43 if (query) {
44 contacts = matchSorter(contacts, query, { keys: ['first', 'last'] })
45 }
46 return contacts.sort(sortBy('last', 'createdAt'))
47}
48
49export async function createContact(
50 data: Pick<Contact, 'first' | 'last' | 'twitter' | 'avatar' | 'notes'>,

Callers 2

contactListQueryFunction · 0.90
createContactFunction · 0.85

Calls 1

fakeNetworkFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…