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.1 to 0.0.3

dist/index.js

16

package.json
{
"name": "rxjs-ws-channels-filters",
"version": "0.0.1",
"version": "0.0.3",
"description": "RxJS websockets implementation with channels and filters",
"main": "lib/index.js",
"main": "dist/index.js",
"dependencies": {

@@ -13,2 +13,4 @@ "rxjs": "^5.3.0"

"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-useref": "^3.1.2",
"http-proxy-middleware": "^0.17.4",

@@ -19,7 +21,11 @@ "serve-static": "^1.12.1",

"scripts": {
"startNode": "node node/index.js",
"startBrowser": "gulp serve",
"start-node": "node node/index.js",
"start-browser": "gulp serve",
"start": "gulp serve | node node/index.js",
"test": "test"
"test": "test",
"build": "gulp build"
},
"files": [
"dist/*"
],
"author": "Tiberiu Zuld",

@@ -26,0 +32,0 @@ "repository": "https://github.com/tiberiuzuld/rxjs-ws-channels-filters.git",

@@ -6,5 +6,45 @@ # rxjs-ws-channels-filters

```javascript
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
* finish up filters
* test and cleanup invalidUrl/authorization in url
* add ability to send user messages to server on a channel and filter

@@ -11,0 +51,0 @@ * add option for user custom filtering of channel and filters

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