Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@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
The npm package @tanstack/query-devtools receives a total of 716,311 weekly downloads. As such, @tanstack/query-devtools popularity was classified as popular.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.