Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AsyncStorage as localStorage alternative on mobile #48

Open
sanjarcode opened this issue Oct 6, 2023 · 0 comments
Open

AsyncStorage as localStorage alternative on mobile #48

sanjarcode opened this issue Oct 6, 2023 · 0 comments
Assignees

Comments

@sanjarcode
Copy link
Member

sanjarcode commented Oct 6, 2023

AsyncStorage lib behavior is almost completely like window.localStorage, except:

  1. Is async. most such solutions are async. Not a problem, but is a complicated solution if all you want is a cookies alternative.
  2. crashes (instead of return null) when you try to store a non-empty value.
  3. Cannot store '', number, boolean, null, undefined. A simple wrapper fixes this.
  4. Works for Android, ios
  5. Default size limit 6MB, resizable through option

cred: 620k stars
npm: https://www.npmjs.com/package/@react-native-async-storage/async-storage
docs: https://react-native-async-storage.github.io/async-storage/

@sanjarcode sanjarcode self-assigned this Oct 6, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant