json-api-store
json-api-store copied to clipboard
Add a describe() method for resource meta information
var store = new Store();
store.define("products", {
title: Store.attr(),
category: Store.hasOne(),
comments: Store.hasMany()
});
store.describe("products");
// {
// fields: [ "title", "category", "comments" ],
// attributes: [ "title" ],
// relationships: [ "category", "comments" ],
// hasOnes: [ "category" ],
// hasManys: [ "comments" ],
// pseudonyms: [ "products", "product" ]
// }