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

Function readId

packages/angular-query/src/__tests__/inject-mutation.test-d.ts:14–16  ·  view source on GitHub ↗
(
      mutation: CreateMutationResult<T>,
    )

Source from the content-addressed store, hash-verified

12describe('injectMutation', () => {
13 it('supports reading data from a generic result type', () => {
14 const readId = <T extends { id: number }>(
15 mutation: CreateMutationResult<T>,
16 ) => mutation.data()?.id
17
18 expectTypeOf(readId).toBeCallableWith(
19 {} as CreateMutationResult<{ id: number }>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected