Querying & Inserting data

You can now work with IndexedDB! For example, let's image you query some items from a server:

let { indexedDB, ajax } = this;

ajax.request('/items').then((items) => {
 indexedDB.add('item', items);
});

// Later, fetch them again
indexedDb.findAll('item').then((items) => {
 // Here are the JSONAPI-payloads again!
});

If you do not use JSONAPI, you should convert it to the JSONAPI format before calling indexedDB.add('item', items);.