npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-rxmq

v1.0.0

Published

Angular 6 wrapper for [Rxmq.js](https://github.com/rxmqjs/rxmq.js) - in-memory message bus based on [reactive extensions](https://github.com/Reactive-Extensions/RxJS).

Downloads

54

Readme

ngx-rxmq

Angular 6 wrapper for Rxmq.js - in-memory message bus based on reactive extensions.

Rxmq.js docs

Rxmq.js

Docs Rxmq.js

Install

Npm:

npm install ngx-rxmq rxmq --save

Yarn:

yarn add ngx-rxmq rxmq

Description

Package provides RxmqService that is a wrapper for Rxmq message broker. RxmqService provides channel, registerChannelPlugin and registerPlugin methods which corresponds with Rxmq methods and requestResponseChannel which return RequestResponseChannel.

ngx-rxmq provide a MQable interface.

interface MQable {
  connect(mq: RxmqService): void;
}

It should be used in service provided as arguments for forRoot and forFeature static methods of NgxRxmqModule. On provided service connect method will be called with RxmqService as argument. Instances of this services will be created at start up of application (forRoot) or on load of a feature module (forFeature).

Usage

Basic usage

Import NgxRxmqModule.forRoot() in AppModule. For feature modules (lazy loaded) import per module NgxRxmqModule.forFeature()

In component - use of Channel:

export class DemoAComponent implements OnInit {

  message$: Observable<string>;

  constructor(private mq: RxmqService) { }

  ngOnInit() {
    this.message$ = this.mq.channel<{message: string}>('demo-a').observe('add.element')
      .pipe(map(event => event.message));
  }

  emitA() {
    this.mq.channel<{message: string}>('demo-a').subject('add.element').next({message: 'Added element to demo-a'});
  }
}

Usege with services

Import NgxRxmqModule in AppModule:

@NgModule({
  imports: [
    ...
    NgxRxmqModule.forRoot([DemoAService, DemoBService]),
    ...
  ],
  providers: [
    DemoAService,
    DemoBService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Services:

@Injectable({
  providedIn: 'root'
})
export class DemoAService implements MQable {

  constructor(private mq: RxmqService) { }

  connect(mq: RxmqService): void {
    mq.channel<{message: string}>('demo-a').observe('add.element')
      .subscribe((event) => {
        console.log('demo-a:add.element', event);
      });
  }

  emit() {
    this.mq.channel<{message: string}>('demo-b').subject('add.element').next({message: 'added element to demo-b'});
  }
}

@Injectable({
  providedIn: 'root'
})
export class DemoBService implements MQable {

  constructor() { }

  connect(mq: RxmqService): void {
    mq.channel<{message: string}>('demo-b').observe('add.element')
      .subscribe((event) => {
        console.log('demo-b:add.element', event);
      });
  }
}

Service DemoAService and DemoBService will be created at startup of application. There is not need to inject this services to component if this services only listen to message queue and act base on event passed to queue eg. side effects, http requests.

For feature modules:

@NgModule({
  imports: [
    ...
    NgxRxmqModule.forFeature([FeatureAService]),
    ...
  ],
  declarations: [FeatureAComponent]
})
export class FeatureAModule { }

Feature service:

@Injectable({
  providedIn: 'root'
})
export class FeatureAService implements MQable {

  constructor() { }

  connect(mq: RxmqService) {
    console.log('FeatureAService.connect', mq);
    mq.channel('demo-a').observe('add.element')
      .subscribe((event) => {
        console.log('Feature A service: demo-a:add.element', event);
      });
  }

}

Feature component:

@Component({
  selector: 'app-feature-a',
  templateUrl: './feature-a.component.html',
  styleUrls: ['./feature-a.component.css']
})
export class FeatureAComponent implements OnInit {

  public readonly form: FormGroup;
  private readonly demoAChanel: Channel<{message: string}>;
  private readonly demoBChanel: Channel<{message: string}>;

  constructor(private formBuilder: FormBuilder, private mq: RxmqService) {
    this.form = formBuilder.group({
      messageDemoA: [''],
      messageDemoB: [''],
    });

    this.demoAChanel = this.mq.channel('demo-a');
    this.demoBChanel = this.mq.channel('demo-b');
  }

  ngOnInit() {
    this.demoAChanel.observe('add.element')
      .pipe(
        map(e => e.message),
        filter((message) => {
          return this.form.get('messageDemoA').value !== message;
        })
      )
      .subscribe((message) => {
        this.form.patchValue({
          messageDemoA: message
        });
      });
  }

  sendDemoA() {
    this.demoAChanel.subject('add.element').next({message: this.form.get('messageDemoA').value});
  }

  sendDemoB() {
    this.demoBChanel.subject('add.element').next({message: this.form.get('messageDemoB').value});
  }
}

Contributors

Daniel Dereziński

Licence

MIT