1

I have an angular project that calls api using grpc web. is there any way I can convert this to promise?,

grpc.unary(User.Search, {
  request: request,
  metadata:metadata,
  host: environment.api.gRpcUser,
  onEnd: res => {
    const { status, message } = res;
    if (status === grpc.Code.OK && message) {
      var result = message.toObject() as SearchReply.AsObject;
      if (result.resultsList) {
       return users = result.resultsList;
      }
      this.isLoading = false;
    }
  }
});
DisplayName
  • 71
  • 1
  • 7

0 Answers0