Is there any way to “commit” the state in Redux to free memory?

后端 未结 1 381
温柔的废话
温柔的废话 2021-01-18 18:39

I\'m working on a real-time multiplayer game and I use Redux on both the server and the client to store the state of the application.

However, the amount of actions

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-18 19:05

    Note that while the Redux DevTools do store the history of actions to enable the time-travel debugging feature, Redux itself does not - it only keeps a reference to the current state. The DevTools also have some additional overhead due to rendering the list of actions and store contents.

    Beyond that: what makes you say that Redux is "using a lot of memory"? The only memory that Redux uses is whatever is needed to represent the store state. Unless you have some particular benchmarks that actually show memory problems, I wouldn't see it as a meaningful concern.

    0 讨论(0)
提交回复
热议问题