欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

浅淡 RxJS WebSocket

程序员文章站 2022-05-26 14:56:16
```const open$ = new Subject(); const ws = webSocket({ url: 'wss://echo.websocket.org', openObserver: open$ }); // 订阅打开事件 open$.subscribe(() => {});``... ......

const open$ = new subject(); const ws = websocket({ url: 'wss://echo.websocket.org', openobserver: open$ }); // 订阅打开事件 open$.subscribe(() => {});

// an highlighted block
var foo = 'bar';