-
-
Save AlexDaSoul/79a172c9829eeb1fc7a8cf6d41c6b857 to your computer and use it in GitHub Desktop.
nga-27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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