-
Notifications
You must be signed in to change notification settings - Fork 172
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
Change getItem
's default to undefined
#1005
Comments
The storage API has a built-in way of providing default values. const [value1, value2] = await Promise.all([
storage.getItem<Type1>("local:key1", { fallback: "foo" }),
storage.getItem<Type2>("local:key2", { fallback: "bar" }),
]); The storage APIs were designed to feel similar to I'm not necessarily opposed to this, |
Huh, I was not aware of the |
But does it actually affect |
Is your feature request related to a bug?
N/A
Feature request
Suppose I want to fetch multiple storage values, currently, it'll look like:
I prefer having this code instead:
which can be achieved without triggering a TypeScript error by changing
null
toundefined
inwxt/packages/wxt/src/storage.ts
Line 309 in e3f00d2
The text was updated successfully, but these errors were encountered: