Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rationalize frontend messages store #1091
The frontend messages store got a bit disorganized lately, with three vuex modules containing conversations and messages:
Problems as of now:
I guess at this stage it makes sense to rethink messages storage.
I wouldn't consider this a problem, I think it's quite natural that some of the store module state is denormalized. I would like it if vuex gave an option to have global mutations when using namespaced modules (such that you can commit a change, and multiple modules can receive the mutation and update their state as appropriate) - which we could implement ourselves if it seems a good way forward.
The global mutations pattern could help with this too. An extension of the idea would be to slightly seperate "read" (getters) and "write" (actions) steps - so we might trigger all conversation-related actions in a conversations module (that does not keep (much) state), but let other modules receive the mutations in order to manage the state in a more specific way.
I would also consider it in the context of #1066 (<-- ooh 1066 is the date of the Battle of Hastings)