Releases: HuolalaTech/react-query-kit
Releases ยท HuolalaTech/react-query-kit
2.0.6
2.0.6-beta.0
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
2.0.4
2.0.3
feat: export all of types
fix: remove type "DefaultError" imported from React Query
2.0.2
2.0.1
- feat: export type
CreateMutationOptions
- feat: add new typeUtil
inferError
2.0.0
Changes
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
- feat: add type util inferOptions
- feat: middleware supports pass in custom hook
- other: remove createImmutableQuery
1.5.1
fix: remove middleware's log
docs: optimize middleware's doc