File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 22
33import Sentencer from 'sentencer' ;
44import { ExampleTwoRequest } from './example2_pb' ;
5- import { ExampleServicePromiseClient , ExampleServiceClient } from './example_grpc_web_pb' ;
5+ import { ExampleServiceClient , ExampleServicePromiseClient } from './example_grpc_web_pb' ;
66import { ExampleOneRequest , StreamRequest } from './example_pb' ;
77
88const __DEV__ = true ;
@@ -52,8 +52,17 @@ function exampleStream(isErr) {
5252 stream . on ( 'error' , console . log ) ;
5353}
5454
55+ function exampleStreamChain ( ) {
56+ client . streamingExample ( new StreamRequest ( ) )
57+ . on ( 'data' , res => {
58+ document . body . innerHTML += `<div>${ res . getTime ( ) } </div>` ;
59+ } )
60+ . on ( 'status' , console . warn )
61+ . on ( 'error' , console . error ) ;
62+ }
63+
5564exampleOne ( )
56- exampleStream ( )
65+ exampleStreamChain ( )
5766exampleStream ( true )
5867setInterval ( exampleOne , 8000 )
5968setInterval ( exampleTwo , 10000 )
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ window.__GRPCWEB_DEVTOOLS__ = function (clients) {
5656 }
5757 StreamInterceptor . prototype . on = function ( type , callback ) {
5858 this . _callbacks [ type ] = callback ;
59+ return this ;
5960 }
6061 clients . map ( client => {
6162 client . client_ . rpcCall_ = client . client_ . rpcCall ;
You can’t perform that action at this time.
0 commit comments