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