Skip to content

Commit

Permalink
Fixed bug introduced in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Scanferla committed Jul 16, 2014
1 parent 3af6c0b commit 29d2756
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asteroid",
"version": "0.3.5",
"version": "0.3.6",
"homepage": "https://github.com/mondora/asteroid",
"authors": [
"Paolo Scanferla <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asteroid",
"version": "0.3.5",
"version": "0.3.6",
"description": "Aletrnative Meteor client",
"main": "dist/node.asteroid.js",
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions src/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ Subscription.prototype._onError = function (err) {
Asteroid.prototype.subscribe = function (name /* , param1, param2, ... */) {
// Assert arguments type
must.beString(name);
// Collect arguments into array
var args = Array.prototype.slice.call(arguments);
// Hash the arguments to get a key for _subscriptionsCache
var params = Array.prototype.slice.call(arguments, 1);
var hash = JSON.stringify(params);
var hash = JSON.stringify(args);
// Only subscribe if there is no cached subscription
if (!this._subscriptionsCache[hash]) {
// Collect arguments into array
// Get the parameters of the subscription
var params = args.slice(1);
var sub = new Subscription(name, params, hash, this);
this._subscriptionsCache[hash] = sub;
this.subscriptions[sub.id] = sub;
Expand Down

0 comments on commit 29d2756

Please sign in to comment.