在 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”中缺少索引签名。