Merge pull request #26 from kawin-impekable/feature/disconnect_method

Add disconnect method & Update documentation
master
Viraj Trivedi 7 years ago committed by GitHub
commit 6018eeda31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,6 +53,7 @@ const auth = realTimeApi.login(USERNAME, PASSWORD);
| onCompletion(() => console.info("Complete")) | Subscribes to Completion on the Websocket Connection | | onCompletion(() => console.info("Complete")) | Subscribes to Completion on the Websocket Connection |
| subscribe(messageHandler, errorHandler, completionHandler) | Subscribes to All three i.e - messages, errors and completion | | subscribe(messageHandler, errorHandler, completionHandler) | Subscribes to All three i.e - messages, errors and completion |
| getObservable() | Returns observable of the WebSocket Connection to the RealTime API | | getObservable() | Returns observable of the WebSocket Connection to the RealTime API |
| disconnect() | Disconnect the WebSocket Connection between client and RealTime API |
| | | | | |

@ -33,6 +33,13 @@ export class RealTimeAPI {
return this.webSocket.catch(err => Observable.of(err)); return this.webSocket.catch(err => Observable.of(err));
} }
/**
* Disconnect the WebSocket Connection between client and RealTime API
*/
public disconnect() {
return this.webSocket.unsubscribe();
}
/** /**
* onMessage * onMessage
*/ */

Loading…
Cancel
Save