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
Returning Promise for the identify() to avoid race condition #200
Conversation
@@ -187,13 +187,24 @@ export class Mixpanel { | |||
* Mixpanel using the same disinct_id will be considered associated with the | |||
* same visitor/customer for retention and funnel reporting, so be sure that the given | |||
* value is globally unique for each individual user you intend to track. | |||
* | |||
* @returns {Promise} A promise that resolves when the identify is successful. | |||
* It does not return any value. |
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.
Is this a breaking API change?
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's still compatible with the old way of calling the api.
resolver resolve: RCTPromiseResolveBlock, | ||
rejecter reject: RCTPromiseRejectBlock) -> Void { | ||
resolver resolve: @escaping RCTPromiseResolveBlock, | ||
rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { |
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 also need to update the Android side?
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.
android is a sync call so it should be fine
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.
LGTM
address #147