Skip to content

Latest commit

 

History

History

hydra

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Hydra

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.

Usage

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 the hydra:totalItems response payload.
  • items. Gets them from the hydra:member response payload.