Derived state is computed from other state, not stored directly.
Stored (problematic):
{
items: [...],
totalCount: 5, // Duplicate!
filteredItems: [...] // Stale risk!
}
Derived (correct):
const totalCount = items.length;
const filteredItems = items.filter(...);
Selectors: Functions that compute derived state. Memoize them for performance.
const selectFilteredItems = (state) =>
state.items.filter(i => i.category === state.filter);