Skip to content

Add ability to use another local storage instead of AsyncStorage #110

Description

@flixyudh

is it possible to use another local storage like RN MMKV-storage instead of AsyncStorage ?

I've tried something like this:

import Parse from 'parse/react-native';
import {MMKV} from './mmkv';

Parse.setAsyncStorage(MMKV); //here's i used MMKV instead of AsyncStorage
Parse.initialize('APP ID', 'JS ID');
Parse.serverURL = 'Server URL';

export const register = async (email, password) => {
  try {
    return await Parse.User.signUp(email, password);
  } catch (error) {
    alert(error);
  }
};

and an error appear

error XMLHttpRequest failed: "this.getAsyncStorage is not a function. (In 'this.getAsyncStorage()', 'this.getAsyncStorage' is undefined)"

dependencies:

"parse": "^3.5.0-beta.1",
"react-native-mmkv-storage": "^0.8.0",

but when i used
"parse": "^3.4.4",
there's no error and i think Parse class get stuck in

export const register = async (email, password) => {
  try {
    console.log('start') //appear
    return await Parse.User.signUp(email, password); //stuck here
    console.log('end') //never called
  } catch (error) {
    alert(error);
  }
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions