Adding getters to debugging support of Realm.Sync.User (#1892)

This commit is contained in:
Kenneth Geisshirt 2018-06-27 09:15:06 +02:00 committed by GitHub
parent 77026c7a19
commit 9a37726012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -19,6 +19,7 @@ X.Y.Z Release notes
### Internals
* Upgraded to Realm Core v5.6.3.
* Upgraded to Realm Sync v3.5.8.
* Added properties of `Realm.Sync.User` to debugger support.
* Fixed class names in API documentation.

View File

@ -21,7 +21,7 @@
import { createUser as createUserRPC, _adminUser as _adminUserRPC, getAllUsers as getAllUsersRPC, _getExistingUser as _getExistingUserRPC } from './rpc';
import { keys, objectTypes } from './constants';
import { createMethods } from './util';
import { getterForProperty, createMethods } from './util';
export default class User {
static createUser(server, identity, token, isAdminToken, isAdminUser) {
@ -39,7 +39,13 @@ export default class User {
static _getExistingUser(server, identity) {
return _getExistingUserRPC(Array.from(arguments));
}
}
};
Object.defineProperties(User.prototype, {
token: { get: getterForProperty('token') },
server: { get: getterForProperty('server') },
identity: { get: getterForProperty('identity') },
});
createMethods(User.prototype, objectTypes.USER, [
'_logout',