Socket
Socket
Sign inDemoInstall

rxjs-ws-channels-filters

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rxjs-ws-channels-filters - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

16

dist/index.js

@@ -242,2 +242,4 @@ 'use strict';

invalidUrl: userOptions.invalidUrl,
transformResponse: userOptions.transformResponse,
transformRequest: userOptions.transformRequest,
channelJoinAction: userOptions.channelJoinAction || defaultOptions.channelJoinAction,

@@ -272,7 +274,15 @@ channelLeaveAction: userOptions.channelLeaveAction || defaultOptions.channelLeaveAction,

inputSubscription = vm.subject.subscribe(function (data) {
socket.send(JSON.stringify(data));
var message = data;
if (vm.options.transformRequest) {
message = vm.options.transformRequest(JSON.parse(JSON.stringify(message)));
}
socket.send(JSON.stringify(message));
});
};
socket.onmessage = function (message) {
observer.next(JSON.parse(message.data));
socket.onmessage = function (response) {
var message = JSON.parse(response.data);
if (vm.options.transformResponse) {
message = vm.options.transformResponse(message);
}
observer.next(message);
};

@@ -279,0 +289,0 @@ socket.onerror = function (error) {

2

package.json
{
"name": "rxjs-ws-channels-filters",
"version": "0.0.3",
"version": "0.0.4",
"description": "RxJS websockets implementation with channels and filters",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -17,2 +17,15 @@ # rxjs-ws-channels-filters

});
},
transformResponse: function (message) {
return message;
},
transformRequest: function (message) {
if (message.filters && message.filters.length) {
var i = message.filters.length - 1;
for (; i > -1; i--) {
message.filters[i].type = message.channel;
}
}
return message;
}

@@ -52,5 +65,3 @@ };

* 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
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc