Skip to content

Instantly share code, notes, and snippets.

@porfidev
Created November 3, 2017 15:07
Show Gist options
  • Save porfidev/bc00cf411b2eb1027c7a147a32647813 to your computer and use it in GitHub Desktop.
Save porfidev/bc00cf411b2eb1027c7a147a32647813 to your computer and use it in GitHub Desktop.
ngZone on Observable
return Observable.create(observer => {
this.ngZone.run(() => {
params.callback = (result) => {
if (result.status === 'FAIL') {
observer.error(result.errorDetails || result.errorMessage);
} else {
observer.next(result);
observer.complete();
}
};
gigya.accounts.login(params);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment