refactor(core): optimize the usage of indexedDB #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
正如 https://github.com/jakearchibald/idb-keyval/blob/main/custom-stores.md 里一直在强调的,idb-keyval 实在是太过于精简了,难以发挥 indexedDB 的全部实力)看了眼源码,也只是对 https://github.com/jakearchibald/idb 的封装,所以还是迁移到 idb 好了🧐
这是一个很大的重构,pinia 实例再也不用存所有的微博数据了,转为使用 indexedDB 的游标 cursor 来实现分页。
同时对 text 和时间建立索引,全文搜索再也不用傻傻地全部加载再正则匹配了😅