0.4.7 • Published 6 years ago

jsonapi-js v0.4.7

Weekly downloads
115
License
-
Repository
-
Last release
6 years ago

https://travis-ci.org/lonelyplanet/jsonapi-js

jsonapi-js

A small library for consuming a JsonAPI.

Using it

npm install --save jsonapi-js
import { Resource } from "jsonapi-js";

export default class Endpoint extends Resource {
  endpoint = "foo";
}

const foo = new Endpoint();

foo.findById(1).then(({ model, response }) => {
  // model is a mash of attributes, and all merged relationships from includes
  // resource is the raw response
});

foo.find({
  include: ["some-relationship"],
  filter: {
    someKey: "baz"
  }
}).then(({ model, response }) => {
  // model is a mash of attributes, and all merged relationships from includes
  // resource is the raw response
  // model is an array in this case
});
0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.26

8 years ago

0.2.25

8 years ago

0.2.24

8 years ago

0.2.23

8 years ago

0.2.22

8 years ago

0.2.21

8 years ago

0.2.20

8 years ago

0.2.19

8 years ago

0.2.18

8 years ago

0.2.17

8 years ago

0.2.16

8 years ago

0.2.15

8 years ago

0.2.14

8 years ago

0.2.13

8 years ago

0.2.12

8 years ago

0.2.11

8 years ago

0.2.10

8 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago