-
-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add storage.clear
#1368
feat: Add storage.clear
#1368
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I don't quite see why the module would need it if you have |
Yes, I agree that current approach of using However, I believe it would be much better if all my storage operations were handled uniformly through wxt-storage. At the moment, I use wxt-storage and directly call browser.storage..clear() because the method is not wrapped. But I wish I can handle all my storage operation in wxt-storage. In my opinion, consolidating all storage operations under a single abstraction layer would not only simplify the code but also provide a more consistent and pleasant development experience for developer using wxt. But if wxt-storage is aimed to be a small package and only work for those complex method, I think clear can be ignored, as user can clean their storage easily with directly call and it should be enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, looks good. Some small changes and we can get this merged!
Co-authored-by: Aaron <[email protected]>
Co-authored-by: Aaron <[email protected]>
@wxt-dev/auto-icons
@wxt-dev/i18n
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-vue
@wxt-dev/storage
@wxt-dev/module-svelte
@wxt-dev/unocss
wxt
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1368 +/- ##
==========================================
- Coverage 81.34% 81.25% -0.10%
==========================================
Files 128 128
Lines 6288 6288
Branches 1072 1071 -1
==========================================
- Hits 5115 5109 -6
- Misses 1158 1164 +6
Partials 15 15 ☔ View full report in Codecov by Sentry. |
storage.clear
Though it is easy to call browser.storage.clear() to clear all the items, I guess it is needed to support clear in wxt storage. So I add this method.