Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
@tanstack/query-devtools
Advanced tools
Developer tools to interact with and visualize the TanStack Query cache
@tanstack/query-devtools is a set of development tools for React Query (now part of TanStack Query). It provides a visual interface to inspect and debug queries, mutations, and cache in your application.
Devtools UI
The Devtools UI provides a visual interface to inspect and debug queries and mutations. You can toggle it open and closed within your application.
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
function App() {
return (
<>
<YourAppComponents />
<ReactQueryDevtools initialIsOpen={false} />
</>
);
}
Inspect Queries
You can inspect the state of your queries, including their data, loading status, and errors. This helps in understanding the flow and state of data fetching in your application.
import { useQuery } from '@tanstack/react-query';
function Example() {
const { data, error, isLoading } = useQuery(['todos'], fetchTodos);
if (isLoading) return 'Loading...';
if (error) return 'An error occurred';
return (
<div>
{data.map(todo => (
<div key={todo.id}>{todo.title}</div>
))}
</div>
);
}
Inspect Mutations
You can inspect the state of your mutations, including their data, loading status, and errors. This helps in understanding the flow and state of data mutations in your application.
import { useMutation } from '@tanstack/react-query';
function AddTodo() {
const mutation = useMutation(newTodo => fetch('/api/todos', {
method: 'POST',
body: JSON.stringify(newTodo)
}));
return (
<button
onClick={() => {
mutation.mutate({ title: 'New Todo' });
}}
>
Add Todo
</button>
);
}
Redux DevTools is a set of tools to help debug Redux applications. It provides a time-traveling debugger, action log, and state inspector. Compared to @tanstack/query-devtools, it is more focused on state management rather than data fetching and caching.
MobX React DevTools is a set of tools for debugging MobX applications. It provides a visual interface to inspect observable state, actions, and reactions. Compared to @tanstack/query-devtools, it is more focused on state management and reactivity rather than data fetching and caching.
Apollo Client DevTools is a set of tools for debugging Apollo Client applications. It provides a visual interface to inspect GraphQL queries, mutations, and cache. Compared to @tanstack/query-devtools, it is more focused on GraphQL data fetching and caching.
FAQs
Developer tools to interact with and visualize the TanStack Query cache
We found that @tanstack/query-devtools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.