Comments (3)
I think unless a very strong use-case for needing this as opposed to doing something in your query function is made, we'll hold off on this.
It's also important to remember that because the query ID is derived from the string and variables, the query function does not need to be stable or memoized. This means you can do inline functions as much as your heart desires:
useQuery('key', () => queryFn().then(res => res.code === '200' ? res.data : null))
from query.
from query.
I think unless a very strong use-case for needing this as opposed to doing something in your query function is made, we'll hold off on this.
It's also important to remember that because the query ID is derived from the string and variables, the query function does not need to be stable or memoized. This means you can do inline functions as much as your heart desires:
useQuery('key', () => queryFn().then(res => res.code === '200' ? res.data : null))
Thx for the answer.
from query.
Related Issues (20)
- Unable to type the `useMutationState` hook HOT 1
- [svelte-query] derived `$page.params` store will becomes undefined during client side navigation HOT 2
- Homepage is erroring HOT 3
- eslint-plugin-query: exhaustive-deps error not triggered when dependency is nested inside then/catch HOT 1
- Vue.js example in the docs doesn't work HOT 2
- Devtools client prop is not working on Astro
- The object passed to the `queryFn` should be typed as `QueryFunctionContext` when using `useQueries` HOT 3
- Prefetched queries in SvelteKit that uses TRPC are refetched on the client regardless of staleness
- Cancelling query retry on observer unsubscribe inconsistency HOT 2
- useInfiniteQuery causes NotifyEventQueryObserverOptionsUpdated event to be fired without query set
- different behavior without/with developer console HOT 3
- react query 3.39.3 devtools error HOT 1
- Error Boundary Error: A component suspended HOT 1
- The query gets stuck at `fetching` status when re-fetched data has cycles HOT 4
- Devtools + async persistence + custom queryKeyHashFn doesn't work HOT 14
- Solid Query: App crashes when a query in a component is resolved before a query in a context provider HOT 2
- 'PersistQueryClientProvider' refers to a value, but is being used as a type here. Did you mean 'typeof PersistQueryClientProvider' HOT 2
- docs: Wrong URL for Nextjs example HOT 5
- `useQuery` with `initialData` is returning `undefined` data when another query with the same key a no `initialData` is fetching HOT 3
- Example of Nextjs suspence streaming doesn't work on the site HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from query.