You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letbook=api.get('/books/1')book.change({numPages: 500})// New page count is saved in Vuex, but not yet sent to API. isDirty flag is true.book.save()// All dirty changes are sent back to the API, including response handling (i.e. reset to the dirty state on error, etc.)
At the moment we don't have the need for this feature, since the dirty handling logic in our use cases mostly shouldn't affect the state of the whole application (which is defined via the Vuex store). For delete, we already have the deleted eager mechanic in place, but for patch, there are a lot more edge cases (e.g. correct rollback when multiple patch operations are pending, and only some fail when saving to the API).
In cases where changing the Vuex store eagerly / optimistically is necessary before the response of a patch operation arrives, we will introduce #6 instead, which the developer has to use explicitly and handle the consequences himself.
Vuex ORM has an extra plugin to handle dirty data (https://github.com/vuex-orm/plugin-change-flags). We could offer similar functionality for hal-json-vuex.
Originally posted by @usu in ecamp/ecamp3#507 (comment)
The text was updated successfully, but these errors were encountered: