-
-
Notifications
You must be signed in to change notification settings - Fork 595
Updating Parse.LiveQuery to use currentUserAsync. #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Current coverage is
|
sessionToken = currentUser.getSessionToken(); | ||
} | ||
return sessionToken; | ||
let promiseUser = CoreManager.getUserController().currentUserAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is wired to create promiseXXX for each inner promises, why not just chain them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you want to keep this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the issue here? I thought it's more readable than chaining directly from the above.
I tried this out in my react-native app. let subscription = query.subscribe()
subscription.on('open', () => {
console.log('subscription opened');
}); |
I'm working on changing this to keep the interface the same - when landed .subscribe will return a subscription. Sent from my iPhone
|
ceba319
to
a1e48fe
Compare
var liveQueryClient = CoreManager.getLiveQueryController().getDefaultLiveQueryClient(); | ||
liveQueryClient.unsubscribe(this); | ||
this.emit('close'); | ||
let _this = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? I think the arrow function auto bind this for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrow does auto bind but in this case we'll need to distinguish between the promise and the subscription context.
Addressing #232.