Why redux store should be serializable?

前端 未结 3 1911
醉话见心
醉话见心 2021-01-08 00:19

When reading the redux doc I found that the doc mentioned this:

Still, you should do your best to keep the state serializable. Don\'t put anything

3条回答
  •  Happy的楠姐
    2021-01-08 00:57

    Adding to what @Timo said , If you want to setup relation between 2 states in your state tree and use computed values, reselect is the best suitable fit for that scenario. It allows to creareselectors which can be used to define computed states. In your case author can be created using a selector on top of book. https://github.com/reactjs/reselect

提交回复
热议问题