0.4.7 • Published 7 years ago

jsonapi-js v0.4.7

Weekly downloads
115
License
-
Repository
-
Last release
7 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

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.26

9 years ago

0.2.25

9 years ago

0.2.24

9 years ago

0.2.23

9 years ago

0.2.22

9 years ago

0.2.21

9 years ago

0.2.20

9 years ago

0.2.19

9 years ago

0.2.18

9 years ago

0.2.17

9 years ago

0.2.16

9 years ago

0.2.15

9 years ago

0.2.14

9 years ago

0.2.13

9 years ago

0.2.12

9 years ago

0.2.11

9 years ago

0.2.10

9 years ago

0.2.9

9 years ago

0.2.8

9 years ago

0.2.7

9 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago