ecamp / hal-json-vuex

Use a HAL JSON API with a Vuex store.
MIT License
8 stars 3 forks source link

Expain differences between items and allItems #282

Closed manuelmeister closed 1 year ago

manuelmeister commented 1 year ago

When should I use items and when allItems?

carlobeltrame commented 1 year ago

allItems includes items which are marked as deleting. Normally you should use items, to benefit from the optimistic deleting behaviour (i.e. the deleted item already vanishes from items while the DELETE request is still ongoing).

https://github.com/ecamp/hal-json-vuex/blob/e4d893b7427595fe907e83f993ffe911c9cb8384/src/CanHaveItems.js#L20:L21