Skip to content

Commit d7eb29a

Browse files
authored
Update proto loader examples with fixes from upstream (#8)
1 parent aa901e4 commit d7eb29a

File tree

7 files changed

+69
-762
lines changed

7 files changed

+69
-762
lines changed

examples/grpc-proto-loader/.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
14

examples/grpc-proto-loader/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _No proto compiler is used. It's all JavaScript._
88

99
## Issues with this approach
1010

11-
Client streaming message type is incorrect. See https://github.com/murgatroid99/grpc-node/pull/3. This fix is awaiting release.
11+
None that I'm aware of!
1212

1313
## App layout
1414

examples/grpc-proto-loader/client.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,13 @@ function doServerStreamingCall() {
7070
}
7171

7272
function doClientStreamingCall() {
73-
const stream = client.clientStreamingCall(
74-
(error?: grpc.ServiceError) => {
75-
if (error) {
76-
console.error(error.message);
77-
}
73+
const stream = client.clientStreamingCall((error?: grpc.ServiceError) => {
74+
if (error) {
75+
console.error(error.message);
7876
}
79-
);
80-
// FIXME: this should be clientMessage
77+
});
8178
stream.write({
82-
serverMessage: 'Message from client',
79+
clientMessage: 'Message from client',
8380
});
8481
}
8582

0 commit comments

Comments
 (0)