stephenh / ts-proto

An idiomatic protobuf generator for TypeScript
Apache License 2.0
2.13k stars 345 forks source link

Add observable support to grpc-web clients #129

Closed PhilipMantrov closed 3 years ago

PhilipMantrov commented 4 years ago

--ts_proto_opt=outputClientImpl=grpc-web,returnObservable=true All methods (except stream methods) still promise.

stephenh commented 4 years ago

Yeah, that combination of options is not supported. returnObservable only works with the nestjs output.

PhilipMantrov commented 4 years ago

After some investigation i realize what wrong with Observable for stream methods: In interface we have forced Observable (and i find why you doing this (hello nestjs implementation and past issue (https://github.com/stephenh/ts-proto/issues/59)), but in method we have grpc.unary with Promise returned.

For stream methods we need to use grpc.invoke.

Tomorrow i create pr for this feature.

stephenh commented 3 years ago

Pretty this is fixed, and just forgot to close the issue.