Skip to content

Instantly share code, notes, and snippets.

@AlexDaSoul
Created January 19, 2020 15:20
Show Gist options
  • Save AlexDaSoul/79a172c9829eeb1fc7a8cf6d41c6b857 to your computer and use it in GitHub Desktop.
Save AlexDaSoul/79a172c9829eeb1fc7a8cf6d41c6b857 to your computer and use it in GitHub Desktop.
nga-27
export function grpcUnary<T>(promise): Observable<T> {
return from(promise).pipe(
map((response: jspb.Message) => response.toObject()),
catchError((error: Status) => {
if (error.code === StatusCode.UNAUTHENTICATED) {
jwtAuthError$.next();
}
return throwError(error);
}),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment