Skip to content

Releases: HuolalaTech/react-query-kit

2.0.6

2.0.6-beta.0

13 Oct 07:36
Compare
Choose a tag to compare

Changes

feat: replace suspense query with option suspense
docs: remove suspense query

BREAKING CHANGES

Removed createSuspenseQuery and createSuspenseInfiniteQuery and use option suspense instead.

Before:

const useUser = createSuspenseQuery<Response>({
  // ...
})

After

const useUser = createQuery<Response>({
  // ...
})

const { data, error } = useUser({ suspense: true }) // data: Response, error: null

See discussion #38

2.0.5

11 Oct 12:27
Compare
Choose a tag to compare

2.0.4

2.0.3

05 Oct 12:43
Compare
Choose a tag to compare

feat: export all of types
fix: remove type "DefaultError" imported from React Query

2.0.2

28 Sep 19:09
Compare
Choose a tag to compare

2.0.1

20 Sep 09:23
Compare
Choose a tag to compare
  1. feat: export type CreateMutationOptions
  2. feat: add new typeUtil inferError

2.0.0

14 Sep 07:41
Compare
Choose a tag to compare

Changes

  1. feat: optimize middleware type
  2. feat: remove all built-in APIs

BREAKING CHANGES

All built-in APIs(such as useDefaultOptions, functional enabled and setData) are no longer support. Please use middleware instead.

Before:

const useUser = createQuery<Response, Variables>({
  // ...
  enabled: (data) => !data
})

After 2.0.0

const disabledIfHasData: Middleware<QueryHook<Response, Variables>> = useQueryNext => {
  return options => {
    const client = useQueryClient()
    const hasData = () =>
      !!client.getQueryData(useUser.getKey(options.variables))

    return useQueryNext({
      ...options,
      enabled: options.enabled ?? !hasData(),
    })
  }
}

const useUser = createQuery<Response, Variables>({
  // ...
  use: [disabledIfHasData],
})

1.5.2

12 Sep 14:51
Compare
Choose a tag to compare

1.5.1

11 Sep 02:24
Compare
Choose a tag to compare

fix: remove middleware's log
docs: optimize middleware's doc