Skip to content

Function for re-treeing JSON API formatted payloads.

License

Notifications You must be signed in to change notification settings

bor3ham/join-includes

Repository files navigation

join-includes

Build Status Coverage Status npm version Downloads

Function for re-treeing JSON API formatted payloads

Usage

Add to your project:

npm install join-includes

And import the function:

import joinIncludes from 'join-includes'

fetch('http://your-site.com/api/whatever?include=otherstuff').then(response => {
  return response.json()
}).then(data => {
  const joinedData = joinIncludes(data.data, data.included)
  console.log(joinedData)
})

About

Function for re-treeing JSON API formatted payloads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published