light-client
light-client copied to clipboard
dApp: Tidy up Vuex store
Description
Using plain strings for the control-flow of an application is never a good idea. It simply lacks in all advantages that code tools can give you. So does the linter/transcompiler of TypeScript not tell you if the string you typed is actually a wrong one. Because how should it now? It is even worse. This mistake will only become detected when this code gets executed and a error gets printed to the console. Think about stupid typos like singular or plural. So instead of getting a nice validation and even autocompletion for these parameters, you have to struggle manually. Furthermore is it not possible to find references (where is this mutation used for example), nor could refactoring tools be used to for example rename a mutation.
@taleldayekh and I (@weilbith) just experience this trouble while we where refactoring the notification handling. In terms of making a new feature possible we had to understand the details of this store module and then adopt it to the changed needs. Both steps where incredibly hard to achieve and cost a lot of time because we had to search for all locations smartly in combination with running the dapp and watching out for eventual errors while navigating through relevant screens.
Moreover has the structure of the store become inconsistent. So there was introduced the new module for notifications. This module is doing many things very good, like separating the different parts of the store into their own modules. This is a basic concept that is generally advised to do, as soon as the store is larger than a "Hello World" application. But the main store module is still a single huge and messy module. It is hard to get an overview, find things or in general work with it. The same goes for the according test suites.
Acceptance criteria
Tasks
- [ ]
Related to #2186