rxjs-ws-channels-filters
Advanced tools
Comparing version 0.0.1 to 0.0.3
{ | ||
"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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
55
1
12650
8
4