Closed jgaehring closed 3 years ago
I'm not sure yet if I want to implement those operations as plain Vuex mutations and actions, or perhaps wrap them in component methods that I add to all components as a mixin, or if I even want to forgo Vuex all together and roll my own state management tool just for FK.
Another possibility is using Vue's event emitters.
Pretty much done with these operations, with the exception of delete. I'm going to punt on that for now, because I think it will require a gradual transition in our UX, to go from "deleting" logs locally, as we are now, to "hiding" logs. Although there's also the question of how unsynced logs will differ, because they may have changes that are lost, even if the original log still lives on the server.
Regardless, I think as far as the API is concerned, even if we come back to add some delete functionality, we have a good pattern established.
Some remaining issues:
First, do we want to leave updateLog
as it is, where the user has to call
this.$store.commit('updateLog', payload);
Or do we want to apply a mixin which maps mutations and actions (including initializeLog
, syncLog
, etc) to component methods, using Vuex's mapMutation
and mapAction
helpers? I wouldn't want to apply that mixin globally, but perhaps just for the root component of every module.
Second, I still need to document the CRUD operations. Perhaps it would inform the first question if I took a stab at that first, and see if it makes sense that way, before I enshrine it in code.
Resolved by #404.
Provide the basic operations for creating, reading, updating and deleting logs.