createStore使用规范? #11
-
有些项目已经使用单Activity作为compose开发基础,但是当又有原生又有compose的时候就不方便了,请问多个Activity,需要为每个Activity创建配置多个createStore和ReduxProvider吗? 假如我已经这样做了,会有什么问题吗?如内存泄漏,Activity已被经销毁了,但是Store还残留在内存中。 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
包括示例代码在内,可以看到我是建议使用 top-level object 这种方式来创建 Store 对象的,这样的好处就是你可以细化这些store,然后通过 |
Beta Was this translation helpful? Give feedback.
ProvidableCompositionLocal
持有从而实现向下暴露的,当 ReduxProvider 从组件树移除后,其中的内存释放。