【发布时间】:2019-06-06 07:20:21
【问题描述】:
我正在使用 react native、redux 和 firebase,我有一个 1 MB 的数据库导出,其中包含来自加拿大营养文件数据库的食物营养信息。
此数据永远不会改变,并用于用户可以搜索和导入的 FlatList。
对我来说,存储这些信息以供用户在搜索时尽快访问的最佳方式是什么?
我正在考虑简单地将 json 文件包含在我的其他源文件中,并使用 require 从那里调用它。
但是由于我已经设置了 firebase 和 redux,我想知道是否出于某种原因考虑这些选项是否更有意义。
提前感谢您的任何意见。
【问题讨论】:
-
据我所知,从文件导入将是最好的解决方案。如果将数据存储在 redux 存储中,则 won
t be cleared from memory until you kill the app. If you store it in a file you can import wherever your want and when the component is unmounted, whatever youve 导入的数据将从内存中清除。
标签: json firebase react-native redux react-native-flatlist