-
Notifications
You must be signed in to change notification settings - Fork 474
multiGet can return nulls, but the TS types do not reflect this #58
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
Labels
bug
Something isn't working
Comments
Hey @lukewlms, thanks for reporting this. Yes, it seems it slipped through by mistake - obviously, AS can return I'd suggest to update the types. Mind opening a PR? thanks. |
lukewlms
added a commit
to lukewlms/react-native-async-storage
that referenced
this issue
Apr 5, 2019
Per issue: react-native-async-storage#58 `multiGet` types should allow returning `string | null`, not just string.
Created #59 |
krizzu
pushed a commit
that referenced
this issue
Apr 6, 2019
Per issue: #58 `multiGet` types should allow returning `string | null`, not just string.
Merged, thanks. |
Corey-Peyton
added a commit
to Corey-Peyton/async-storage
that referenced
this issue
Jul 14, 2021
Per issue: react-native-async-storage/async-storage#58 `multiGet` types should allow returning `string | null`, not just string.
DenisSolution
pushed a commit
to DenisSolution/React-native-async-storage
that referenced
this issue
Aug 27, 2022
Per issue: react-native-async-storage/async-storage#58 `multiGet` types should allow returning `string | null`, not just string.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Current behavior
Querying AsyncStorage for an unknown key using multiGet can return null values.
However the types indicate this is impossible.
Expected behavior
Types should indicate that returning null is possible, OR null should never be returned (I don't know which is correct, but I would think the types).
Repro steps
Run code:
return value: ["DOES NOT EXIST", null]
Environment
"@react-native-community/async-storage": "^1.2.2",
"react-native": "0.59.1",
The text was updated successfully, but these errors were encountered: