Mobx,redux, these problems of dividing store

  1. has found a lot of information, and it seems that the division of store is recommended for flattening. Up to two layers, such as
    {
       home:homeStore,
       about:aboutStore
    }
  1. so what about the above structure for complex pages? Like home. There are heads, there are creations, there are many blocks of table,. If it"s all in the same store. What about teamwork? There is a conflict every time you get the code. The structure is not clear, and every time I want to add something, it is very inconvenient to transfer the files to store.

at present, we do it like this: but there will also be a problem, that is, it is not convenient for components to communicate with each other.

    {
       homeStore:{
         headerStore,
         tableStore:{
             searchStore,
             listStore
         },
         createStore
       },
       about:aboutStore
    }

can you give me some advice on which one is better? How to solve all kinds of pain points?


Public items should be withdrawn. For example, header footer tabBar belongs to pageConig and should not belong to a single page


I don't know the specific division of labor of your project, but the reducer in store can be split into multiple pieces, and then combined through combineReducers. Everyone only needs to write the corresponding components without conflict.

you can refer to the file structure division of this project .

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c24dc7-32ea8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c24dc7-32ea8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?