StatsHub Docs

AGS and Assist

Anytime goalscorer and assists — two routes over one implementation, after 800 lines existed twice so that one string could differ.

RouteWhat it shows
/agsAnytime goalscorer
/assistThe assist market

Both render src/composed/ags-collection with different props.

Why they are one file

ags.tsx and assist.tsx were 803 and 805 lines that differed by four substantive lines: a component name, one filter id, and playerStatType="expectedAssists" passed to two TeamTotalsOdds.

Eight hundred lines of fixture picking, five queries and a tab shell existed twice so that one string could differ — and a fix to either had to be remembered twice. It usually was not.

The test for a merge

Two boards merge when they read the same endpoints and return the same row shape. These did. Player Trends and Team Trends did not, and were left apart for that reason — they read different endpoints, return different rows and carry different filters.

Structurally, Player Cards is the same board again — the same /api/event/by-date picker feeding the same AGScollection endpoints — but with a different date filter and a stat selector. Folding all three together is a live question rather than a settled one.

On this page