File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -67,27 +67,27 @@ const messages$: Observable<WebSocketPayload> = socket$.pipe(
6767 share (),
6868)
6969
70- const messagesSubscription: Subscription = messages .subscribe (
71- (message : string ) => {
70+ const messagesSubscription: Subscription = messages .subscribe ({
71+ next : (message : string ) => {
7272 console .log (' received message:' , message )
7373 // respond to server
7474 input$ .next (' i got your message' )
7575 },
76- (error : Error ) => {
76+ error : (error : Error ) => {
7777 const { message } = error
7878 if (message === normalClosureMessage ) {
7979 console .log (' server closed the websocket connection normally' )
8080 } else {
8181 console .log (' socket was disconnected due to error:' , message )
8282 }
8383 },
84- () => {
84+ complete : () => {
8585 // The clean termination only happens in response to the last
8686 // subscription to the observable being unsubscribed, any
8787 // other closure is considered an error.
8888 console .log (' the connection was closed in response to the user' )
8989 },
90- )
90+ } )
9191
9292function closeWebsocket() {
9393 // this also caused the websocket connection to be closed
You can’t perform that action at this time.
0 commit comments