48.1.0 • Published 11 months ago

expo-storage v48.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

expo-storage

Simple way to store persistent data, which does not have size limitations of react-native async-storage

Usage

Add to project

yarn add expo-storage

or

expo install expo-storage

Storage

Just like async-storage, expo-storage works with string values and can only store string data, so in order to store object data you need to serialize it first. For data that can be serialized to JSON you can use JSON.stringify() when saving the data and JSON.parse() when loading the data.

import { Storage } from 'expo-storage'

To store item:

   await Storage.setItem({
    key: `${photo.id}`,
    value: JSON.stringify(myJsonObject)
  })

To get item:

  const item = JSON.parse(
    await Storage.getItem({ key: `${item.id}` })
  )

To delete a record by key:

  await Storage.removeItem({ key: `${item.id}` })  

To get all keys available in storage:

  const keys = await Storage.getAllKeys()  

Sample projects

https://github.com/echowaves/WiSaw

https://www.wisaw.com/

48.1.0

11 months ago

48.0.1

1 year ago

48.0.0

1 year ago

47.0.0

1 year ago

46.0.0

2 years ago

44.0.0

2 years ago

43.0.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago