vasern / vasern

Vasern is a fast, lightweight and open source data storage for React Native

Home Page:https://vasern.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property 'perform' of undefined

iMokhles opened this issue · comments

i issue while using this awesome package for the first time ( i wasn't able to fix it at all )
here's my setup

  • Stracture

Capture d’écran 2019-10-06 à 21 00 08

  • Initialization

Capture d’écran 2019-10-06 à 21 00 13

Capture d’écran 2019-10-06 à 21 00 19

  • Usage

Capture d’écran 2019-10-06 à 21 00 55

i keep getting Cannot read property 'perform' of undefined

Capture d’écran 2019-10-06 à 21 02 32

can you help me ?

Okey i was able to fix this issue by setting the Model name same asSchema name

From this

export default class UserModel {
    name = "Users";
    // Note: no "id" in "props", it will be automatically ignored otherwise
    props = {
        userId: "string",
        name: "string",
        email: "string",
        phone: "string",
        lang_code: "string",
        bio: "string",
        site: "string",
        country: "string",
        birth_date: "string",
        gender: "string",
        show_phone: "boolean",
        show_name: "boolean",
        is_blocked: "boolean",
        access_token: "string",
        token_type: "string",
        expires_in: "string",
        created_at: "string",
        isCurrentUser: "boolean",
    }
}

to this

export default class Users {
    name = "Users";
    // Note: no "id" in "props", it will be automatically ignored otherwise
    props = {
        userId: "string",
        name: "string",
        email: "string",
        phone: "string",
        lang_code: "string",
        bio: "string",
        site: "string",
        country: "string",
        birth_date: "string",
        gender: "string",
        show_phone: "boolean",
        show_name: "boolean",
        is_blocked: "boolean",
        access_token: "string",
        token_type: "string",
        expires_in: "string",
        created_at: "string",
        isCurrentUser: "boolean",
    }
}

Hey @iMokhles, good one. I'll be happy to help in case you have other issue :)