html5 - redux单页面应用中 是一个store?
伊谢尔伦
伊谢尔伦 2017-04-17 13:57:45
0
4
1162

单页面应用中,我能否按照不同的路由加载不同的store?
因为系统复杂(比如三十个页面),应该不可能把所有的状态都何在一个store吧?
希望懂得朋友给点建议,谢谢!

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(4)
刘奇

You can use connect on each routing page to obtain the required store

PHPzhong

Because the system is complex (for example, thirty pages), it shouldn’t be possible to store all the states in one store, right?

I think that in redux’s thinking, it is recommended to use one store for each app. Unless some states are completely independent, there will be no connection. Of course, multiple providers can be used, but this can also be regarded as multiple apps. Redux uses reducer tree to divide the structure, and use selector in each container to select the required store. Don’t worry too much about performance issues. react-redux’s connect will also help you optimize most unnecessary rendering, which is generally fine.

左手右手慢动作

I don’t think so, but redux limits one and can only have one store.

The entire application state is stored in an object tree, and this object tree only exists in one store.

阿神

Create store

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!