How to use the @stomp/ng2-stompjs.StompService function in @stomp/ng2-stompjs

To help you get started, we’ve selected a few @stomp/ng2-stompjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Redislabs-Solution-Architects / rediscogs / client / src / app / favorite-albums / favorite-albums.component.ts View on Github external
connectStompService(config: any) {
    const stompUrl = config.protocol + '://' + config.host + ':' + config.port + config.endpoint;
    const stompConfig: StompConfig = {
      url: stompUrl,
      headers: {
        login: '',
        passcode: ''
      },
      heartbeat_in: 0,
      heartbeat_out: 20000,
      reconnect_delay: 5000,
      debug: true
    };
    this.stompService = new StompService(stompConfig);
    this.stompService.subscribe(config.likesTopic).subscribe(like => this.likes.unshift(JSON.parse(like.body)));
  }

@stomp/ng2-stompjs

Angular 6/7/8/9/10 [![Build Status](https://travis-ci.org/stomp-js/ng2-stompjs.svg?branch=master)](https://travis-ci.org/stomp-js/ng2-stompjs)

Apache-2.0
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis