Extracts a single resource from a resource collection, i.e. a NationCollection.
This allows us to maximize the use of the cached requests made by SWR.
Instead of fetching the resources again, separately, we fetch the entire collection
once and extracts the resource that we want from the array.
This also comes with the benefit of automatically invalidating data
that uses single resources. Without this, invalidating the entire collection
would not automatically invalidate the single resource, since it was fetched
using a unique key.
Extracts a single resource from a resource collection, i.e. a NationCollection. This allows us to maximize the use of the cached requests made by SWR. Instead of fetching the resources again, separately, we fetch the entire collection once and extracts the resource that we want from the array.
This also comes with the benefit of automatically invalidating data that uses single resources. Without this, invalidating the entire collection would not automatically invalidate the single resource, since it was fetched using a unique key.