Any advantages by tanstack libraries for solidjs users?
I found that tanstack have some libraries support for solidjs. tanstack query, tanstack table, tanstack virtual.
Any benefits of use of tanstack libraries?
5 Replies
Their query library, I believe, may be helpful for deduping multiple requests to the same resource. When setting up an api call for example, a key must be provided. Say multiple parts of the app require a user's profile data: if they all have the same key, only a single request will be sent out
I use solid query for everything. I'm able to modify/refresh/retrieve the cached data of any query data from anywhere in my app.
You can actually benefit a lot from them, IMHO.
I'd recommend it for more complex requirements. If your tasks are simple, you can use plain solid; for in-between things, there's
@solid-primitives/resource
.I found following currently available features for solidjs. That documentation does not have many details so I check these with React documentation.
createQuery: A hook that fetches and manages data from an API endpoint. It automatically handles caching and provides data loading status.
createQueries: Allows you to use multiple createQuery hooks in parallel for fetching data from multiple API endpoints.
createInfiniteQueries: A hook for implementing infinite scrolling or pagination. It manages loading more data as the user scrolls through a list.
createMutation: A hook for defining and executing mutation operations (e.g., creating, updating, or deleting data) with automatic cache updates.
useIsFetching: A hook that provides information on whether any queries are currently fetching data, useful for showing loading indicators.
useIsMutating: A hook that informs you if any mutations are in progress.
useQueryClient: A hook that provides access to the Query Client instance, allowing you to interact with the query cache and trigger manual refetches or invalidations.
QueryClient: The core object in React Query that manages the query cache, mutation state, and other core functionality.
QueryClientProvider: A component that wraps your application to provide a Query Client instance to all components, ensuring they share the same query cache and state management.
Thank you very much for mention that package. Solid Ecosystem page can not find most use packages like star count, download count etc. So need to go each packages and check.
Thank you for information
Thank you for information
Thank you for information