For quite a while I had a transformItems() conversion function that I used in a few places. Why am I doing it at different call sites instead of transforming the data at the source?
Original:
const { data } = useQuery({
query: "SELECT_ITEMS",
variables: {
params.teamKey
}
})
const items = transformItems(selectItemsData.items);
Refactored:
const items = useSelectItemsQuery(teamKey: string);
Now that I think of it, I did this years ago at work for a different project. Sometimes the mind just slips while thinking of too many things at once.