pinia持久化存储方案——pinia-storage
pinia-storage
- author:syf20020816@outlook.com
- docName:pinia-storage README
- createDate:20230406
- updateDate:20230407
- version:0.0.2
- des-tag:正式版
- email:syf20020816@outlook.com
pinia-storage Introduction
Pinia Storage is Pinia’s persistence storage solution written in TypeScript. It can store the data in the state into localStorage and sessionStorage according to business requirements. It relies on the serialization scheme provided by the faster organization with better performance, greater scalability, and better flexibility: fast json stringify and deserialization scheme: secure json parse. Therefore, it is better than Pinia’s persistence plug-in pinia plugin persist in performance. Similarly, users do not need to worry about how to store data. They only need to set the storage location when creating data, and the updated data will be automatically updated for storage.
Pinia-Storage是使用TypeScript编写的Pinia的持久化存储解决方案,可根据业务需求将state中的数据存储到localStorage和sessionStorage中,依赖于性能更好、扩展性更强、灵活度更好的fastify组织提供的序列化方案:fast-json-stringify和反序列化方案:secure-json-parse,因此在性能上强于pinia的持久化插件pinia-plugin-persist。同样用户无需关心如何进行存储,只需要在创建数据时设置存储位置即可,更新过的数据会自动更新存储。
T