Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.