Socket
Socket
Sign inDemoInstall

rxjs-ws-channels-filters

Package Overview
Dependencies
2
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rxjs-ws-channels-filters

RxJS websockets implementation with channels and filters


Version published
Maintainers
1
Created

Readme

Source

rxjs-ws-channels-filters

RxJS implementation of websockets with channels and filters

Work in progress

  var options = {
    url: 'localhost:3000/api',
    invalidUrl: function (e) {
      return new Promise(function (resolve, reject) {
        setTimeout(function () {
          options.url = 'localhost:3000/api';
          resolve(10);
        }, 1000);
      });
    }
  };

  var socket = rxSocket.create(options);
  console.log(socket);
  socket.channels.subscribe('one', function (message) {
    console.log(message);
  });

  socket.channels.subscribe('one', function (message) {
    console.log('secondSubscription to one');
    console.log(message);
  });

  socket.channels.subscribe('two', function (message) {
    console.log(message);
  });

  var filterSub = socket.channels.subscribeFilter('three', {id: 3}, function (message) {
    console.log('filter', message);
  });

  setTimeout(function () {
    filterSub.unsubscribe();
    var filterSub2 = socket.channels.subscribeFilter('three', {id: 4}, function (message) {
      console.log('filter', message);
    });
  }, 5000);

TODO

  • add ability to send user messages to server on a channel and filter
  • add option for user custom filtering of channel and filters
  • add option for user custom message modifier when message arrives
  • add option for user custom message modifier before message sent to server
  • make a separate repo with a server side node implementation

FAQs

Last updated on 10 Apr 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc