mrichar1 / jsonapi-vuex

Use a JSONAPI api with a Vuex store, with data restructuring/normalization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why does each request accumulate _jv records in the store (or why doesn't status work)?

geoidesic opened this issue · comments

Each time a request is made I end up with an extra record under the _jv node in the store. E.g.:
Screenshot 2019-11-23 at 18 55 50

Some questions:

  1. I'm concerned that this might represent a memory leak?
  2. If I'm interested in the status and timestamp of a request, how do I know which of these records to reference?
  3. The docs say that the response will contain the id of the request... but I'm always only ever seeing id = 1 in the response, which is the id in my persistence layer, i.e. that returned by the back-end api. I'm not seeing a response id which correlates to these request ids.
  4. status as described here: https://github.com/mrichar1/jsonapi-vuex#status doesn't seem to work. It just shows as undefined if I do the console.log(status).

Here's what my response object looks like as returned by the _jv action as an async:
Screenshot 2019-11-23 at 19 09 01

Here's what it looks like as a promise:
Screenshot 2019-11-23 at 19 15 34

The status code is designed in a way that can't be guarenteed to work with how Vuex handles action promises. It will be being rewritten, but this hasn't happened yet.

Closing this in favour of #75