MCPcopy Create free account
hub / github.com/TanStack/query / MutationStatusCount

Function MutationStatusCount

packages/query-devtools/src/Devtools.tsx:1513–1530  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1511}
1512
1513const MutationStatusCount: Component = () => {
1514 const counts = createSubscribeToMutationCacheBatcher((mutationCache) => {
1515 const tally = { green: 0, yellow: 0, purple: 0, red: 0, gray: 0 }
1516 for (const mutation of mutationCache().getAll()) {
1517 tally[getMutationStatusColor(mutation.state)]++
1518 }
1519 return tally
1520 })
1521
1522 return (
1523 <div class="tsqd-style-query-status-container tsqd-query-status-container">
1524 <QueryStatus label="Paused" color="purple" count={counts().purple} />
1525 <QueryStatus label="Pending" color="yellow" count={counts().yellow} />
1526 <QueryStatus label="Success" color="green" count={counts().green} />
1527 <QueryStatus label="Error" color="red" count={counts().red} />
1528 </div>
1529 )
1530}
1531
1532const QueryStatus: Component<QueryStatusProps> = (props) => {
1533 const { selectedQueryHash, panelWidth } = useDevtoolsState()

Callers

nothing calls this directly

Calls 3

getMutationStatusColorFunction · 0.90
getAllMethod · 0.45

Tested by

no test coverage detected