Skip to content

Commit

Permalink
fix: implement abort grpc web (#785)
Browse files Browse the repository at this point in the history
* fix arguments order

* update example

---------

Co-authored-by: HERSENT <francois.hersent@hiventive.com>
  • Loading branch information
hersentino and hersentino authored Mar 11, 2023
1 parent 1213ab1 commit 6a40d72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion integration/grpc-web-no-streaming-observable/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class DashStateClientImpl implements DashState {
metadata?: grpc.Metadata,
abortSignal?: AbortSignal,
): Observable<DashUserSettingsState> {
return this.rpc.unary(DashStateUserSettingsDesc, Empty.fromPartial(request), abortSignal, metadata);
return this.rpc.unary(DashStateUserSettingsDesc, Empty.fromPartial(request), metadata, abortSignal);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/generate-grpc-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function generateRpcMethod(ctx: Context, serviceDesc: ServiceDescriptorProto, me
return this.rpc.${method}(
${methodDescName(serviceDesc, methodDesc)},
${requestMessage}.fromPartial(request),
${useAbortSignal ? "abortSignal," : ""}
metadata,
${useAbortSignal ? "abortSignal," : ""}
);
}
`;
Expand Down

0 comments on commit 6a40d72

Please sign in to comment.