Skip to content

Instantly share code, notes, and snippets.

@mascot6699
Last active October 30, 2019 14:13
Show Gist options
  • Save mascot6699/8a1a3cf2afa411f643fe9ec1bab3e9c2 to your computer and use it in GitHub Desktop.
Save mascot6699/8a1a3cf2afa411f643fe9ec1bab3e9c2 to your computer and use it in GitHub Desktop.
RNLocalStorage is a react native compatible implementation for StorageService required by cruxpay/js-sdk
import { storage } from "@cruxpay/js-sdk/dist/cruxpay-sdk";
import AsyncStorage from "@react-native-community/async-storage";
class RNLocalStorage extends storage.StorageService {
setItem = async (key, value) => AsyncStorage.setItem(key, value);
getItem = async (key) => AsyncStorage.getItem(key);
}
export {RNLocalStorage};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment