The Hydra specification is trying to normalise APIs and starts to get some traction. For example, the API Platform framework allows you to expose an API following the Hydra specification in minutes.
This module is a super-set of the Store module to provide default payload resolvers.
import { hydra } from "@birdiecare/galette-core";
const { reduceListAndItems, reduceItems, reduceList } = hydra;
Use these functions as you'd the ones coming from the Store module but you DO NOT need the following options:
itemIdentifierResolver
. Get the identifier from the@id
item.totalItems
. Get them from thehydra:totalItems
response payload.items
. Gets them from thehydra:member
response payload.