Parse-sdk-js: Subclassing Parse.User

Created on 22 Aug 2016  路  3Comments  路  Source: parse-community/Parse-SDK-JS

import Parse from 'parse';
class CustomUser extends Parse.Object{
static name(){
return 'haha';
}
constructor(){
super('_User');
this.hahah = 'sadad';
}
}
export default CustomUser;

and i have registerSubclass in index file.

Other classes a normaly subclassing, but user not

when i do query:

let newUser = new CustomUser();
let query = new Parse.Query(newUser)

and in callback i have _User object without hahah

pr-submitted

Most helpful comment

Did you try to extend the Parse.User object directly?

Parse.User.allowCustomUserClass(true);
class UserModel extends Parse.User.....

All 3 comments

Did you try to extend the Parse.User object directly?

Parse.User.allowCustomUserClass(true);
class UserModel extends Parse.User.....

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I think this is related to parse-community/parse-server#5521

Was this page helpful?
0 / 5 - 0 ratings