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.5 to 0.0.6

26

dist/index.js

@@ -85,3 +85,5 @@ 'use strict';

var channelSub = initChannel(channel);
return channelSub.observable.subscribe(responseHandle);
var subscriber = channelSub.observable.subscribe(responseHandle);
subscriber.send = createChannelSenderFunction(channel);
return subscriber;
}

@@ -123,3 +125,5 @@

function subscribeFilter(channel, filter, responseHandle) {
return initFilter(channel, filter).observable.subscribe(responseHandle);
var subscriber = initFilter(channel, filter).observable.subscribe(responseHandle);
subscriber.send = createChannelSenderFunction(channel, filter);
return subscriber;
}

@@ -155,2 +159,3 @@

}
return true;
}

@@ -225,2 +230,13 @@ }

function createChannelSenderFunction(channel, filter) {
return function (message) {
vm.connection.subject.next({
action: vm.connection.options.notifyAction,
channel: channel,
filter: filter,
data: message
});
}
}
return {

@@ -240,3 +256,4 @@ subscribe: subscribe,

filterJoinAction: 'ADD',
filterLeaveAction: 'REMOVE'
filterLeaveAction: 'REMOVE',
notifyAction: 'NOTIFY'
};

@@ -255,3 +272,4 @@

filterJoinAction: userOptions.filterJoinAction || defaultOptions.filterJoinAction,
filterLeaveAction: userOptions.filterLeaveAction || defaultOptions.filterLeaveAction
filterLeaveAction: userOptions.filterLeaveAction || defaultOptions.filterLeaveAction,
notifyAction: userOptions.notifyAction || defaultOptions.notifyAction
}

@@ -258,0 +276,0 @@ }

2

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

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

@@ -52,4 +52,11 @@ # rxjs-ws-channels-filters

}
return true;
}
}
},
// default options for actions
channelJoinAction: 'JOIN',
channelLeaveAction: 'LEAVE',
filterJoinAction: 'ADD',
filterLeaveAction: 'REMOVE',
notifyAction: 'NOTIFY'
};

@@ -75,2 +82,4 @@

});
filterSub.send('this is a message, from filter'); //send messages to server on this channel and filter

@@ -87,5 +96,4 @@ setTimeout(function () {

### TODO
* add ability to send user messages to server on a channel and filter
* make a separate repo with a server side node implementation
* make better documentation
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