Skip to content

Instantly share code, notes, and snippets.

@weihungchin
Last active May 3, 2021 13:15
Show Gist options
  • Save weihungchin/3be76a4c3842b64e137de9c5bc8a9eba to your computer and use it in GitHub Desktop.
Save weihungchin/3be76a4c3842b64e137de9c5bc8a9eba to your computer and use it in GitHub Desktop.
import { tap } from 'rxjs/operators';
import { webSocket } from 'rxjs/webSocket';
const wsSubjec2$ = webSocket({
url: 'wss://www.gasnow.org/ws/gasprice',
});
const subA = wsSubject$
.pipe(
tap(data => console.log(data))
)
.subscribe();
const subB = wsSubject$
.pipe(
tap(d => console.log(d))
)
.subscribe();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment