All Projects → aveq-research → localforage-asyncstorage-driver

aveq-research / localforage-asyncstorage-driver

Licence: MIT license
Driver which enables you to use localforage for React-Native's AsyncStorage API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to localforage-asyncstorage-driver

react-native-modest-storage
💾 A modest wrapper around the AsyncStorage API
Stars: ✭ 22 (+22.22%)
Mutual labels:  asyncstorage, asyncstorage-wrapper
mst-persist
Persist and hydrate MobX-state-tree stores (in < 100 LoC)
Stars: ✭ 75 (+316.67%)
Mutual labels:  localforage, asyncstorage
deadlines
A simple, offline deadline tracker made with Vue.js and localForage.
Stars: ✭ 22 (+22.22%)
Mutual labels:  localforage
RN-login-register-screen
Usage of login / sign-in screen with register / sign-up and forget password screen for authentication in react-native with navigation and Async local storage of input values
Stars: ✭ 32 (+77.78%)
Mutual labels:  asyncstorage
aioudp
Asyncio UDP server
Stars: ✭ 21 (+16.67%)
Mutual labels:  asyncstorage
localForage-cn
localForage中文仓库,localForage改进了离线存储,提供简洁健壮的API,包括 IndexedDB, WebSQL, 和 localStorage。
Stars: ✭ 201 (+1016.67%)
Mutual labels:  localforage
Localforage
💾 Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.
Stars: ✭ 19,840 (+110122.22%)
Mutual labels:  localforage
vuex-orm-localforage
Vuex ORM persistence plugin to sync the store against IndexedDB using localforage
Stars: ✭ 51 (+183.33%)
Mutual labels:  localforage
shu-scheduling-helper
A web-based timetabler helping SHUers filter and preselect courses easily. SHU排课助手. 上海大学排课助手.
Stars: ✭ 43 (+138.89%)
Mutual labels:  localforage
client-persist
Offline storage for your web client. Supports IndexedDB, WebSQL, localStorage and sessionStorage with an easy to crawl with API.
Stars: ✭ 14 (-22.22%)
Mutual labels:  localforage
React Native Storage
local storage wrapper for both react-native and browser. Support size controlling, auto expiring, remote data auto syncing and getting batch data in one query.
Stars: ✭ 2,822 (+15577.78%)
Mutual labels:  asyncstorage

localforage-asyncstorage-driver

npm version

This Library contains a driver which enables to use localforage for React-Native's AsyncStorage.

Peer Dependencies

Please note! With the switch to v3.0.0 @react-native-async-storage/async-storage became a peer dependency!!

Setup

Simply install the driver via NPM:

npm i --save @aveq-research/localforage-asyncstorage-driver

If not done yet, make sure to have the appropriate peer dependencies (react resp. react-native) to be installed.

Usage

It delivers three different methods to create an appropriate driver:

  • driverWithoutSerialization(): Create a common AsyncStorage driver which does not serialize any data automatically; you need to integrate your own serialization!
  • driverWithSerialization(serializer): Creates an AsyncStorage driver with the given serializer; A valid serializer needs to contain a serialize and deserialize method
  • driverWithDefaultSerialization(): Will use the default serialization from localforage

Working Code Example:

import { driverWithoutSerialization } from '@aveq-research/localforage-asyncstorage-driver';

const driver = driverWithoutSerialization();
await localforage.defineDriver(driver);
await localforage.setDriver(driver._driver); // i.e. "rnAsyncStorageWrapper"

Alternatively with instance usage:

import { driverWithoutSerialization } from '@aveq-research/localforage-asyncstorage-driver';

const driver = driverWithoutSerialization();
const instance = localforage.createInstance({ driver });

After that you may use localforage as you know it already. For further questions concerning the localforage API, lookup https://github.com/localForage/localForage

License

This driver is distributed under MIT License (see LICENSE) and maintained by the wonderful AVEQ team.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].