mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-07-03 21:36:23 +00:00
Rename anchor -> key globally ¯\_(ツ)_/¯
This commit is contained in:
@ -41,17 +41,17 @@ export class WebSocketService {
|
||||
console.log('ws connected');
|
||||
}
|
||||
|
||||
public observeAnchor<T>(anchor: string): Observable<WSMessage<T>> {
|
||||
return this.downlink.pipe(filter(message => message.anchor === anchor));
|
||||
public observeKey<T>(key: string): Observable<WSMessage<T>> {
|
||||
return this.downlink.pipe(filter(message => message.key === key));
|
||||
}
|
||||
|
||||
public send(anchor: string, data: any): void {
|
||||
public send(key: string, data: any): void {
|
||||
// If the WebSocket is not connected then the QueueingSubject will ensure
|
||||
// that messages are queued and delivered when the WebSocket reconnects.
|
||||
// A regular Subject can be used to discard messages sent when the WebSocket
|
||||
// is disconnected.
|
||||
this.uplink.next({
|
||||
'anchor': anchor,
|
||||
'key': key,
|
||||
'data': data
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user