Socket
Socket
Sign inDemoInstall

@react-native-community/async-storage-backend-web

Package Overview
Dependencies
517
Maintainers
34
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @react-native-community/async-storage-backend-web

Storage backend for `Async Storage`, targeting Web platform.


Version published
Weekly downloads
32K
decreased by-23.88%
Maintainers
34
Install size
94.2 kB
Created
Weekly downloads
 

Readme

Source

Storage Backend: Web

Storage backend for Async Storage, targeting Web platform.

Installation

  1. Get the core
$ yarn add @react-native-community/async-storage@next
  1. Get the the storage
$ yarn add @react-native-community/async-storage-backend-web@next

Usage


import WebStorage from '@react-native-community/async-storage-backend-web';
import AsyncStorageFactory from '@react-native-community/async-storage';

type MyModel = {
  userName: string,
  userId: number
};

const webStorage = new WebStorage('idb'); // see storage options below

const storage = AsyncStorageFactory.create<MyModel>(webStorage);


export default storage;

Storage Options

  • storageType

values: idb | local | session description: Type of store to be used. idb is implemented with IndexedDB, largely based on async-storage by Mozilla, while local and session refers to localStorage and sessionStorage respectively.

License

MIT.

FAQs

Last updated on 04 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc