【发布时间】:2021-03-03 20:33:08
【问题描述】:
在 Stomp 中,我们使用了这些方法:
initUserEvents() {
this.stompService.startConnect().then(() => {
this.stompService.done('init');
this.stompService.subsribe('/channel/login', res => {
if (res.username !== this.username) {
this.newConnectedAccounts.push(res.username);
现在我正在使用 RxStomp,但我无法找到使用这些“替换”方法的正确方法:
initUserEvents() {
this.stompService.configure();
this.stompService.activate(){
this.stompService.watch('/channel/login', res => {
if (res.username !== this.username) {
this.newConnectedAccounts.push(res.username);
我得到的错误是: TS2345:'(res: any) => void' 类型的参数不能分配给'StompHeaders' 类型的参数。 '(res: any) => void' 类型中缺少索引签名。
【问题讨论】:
标签: angular websocket stomp stompjs