Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
什么时候应该坚持,什么时候应该补水?命名约定非常混乱,因为作者几乎没有提到它们在redux-persist上下文中的含义。
在不真正了解图书馆的情况下:
persist = 将存储写入在关闭浏览器会话后仍然存在的任何类型的存储中。
rehydrate = 从该存储中读取数据并将数据放回 javascript 运行时,因此 redux 可以访问它。
至少这是他们应该的意思,如果不是,我建议放弃那个图书馆,因为它令人困惑;)