Socket
Socket
Sign inDemoInstall

ampersand-io-collection

Package Overview
Dependencies
49
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 0.1.3

30

ampersand-io-collection.js

@@ -36,9 +36,2 @@ /*$AMPERSAND_VERSION*/

active: false
},
onFetch: {
fn: function(data, cb){
this.set(data);
return cb();
},
active: false
}

@@ -58,15 +51,18 @@ },

options.cb = options.callback;
options.callback = function (err, resp){
options.callback = function (err, response){
if (err){
this.trigger('error', this, resp, options);
this.trigger('error', this, response, options);
}
};
options.respCallback = function cb(data){
options.respCallback = function cb(data, cbServer){
var method = options.reset ? 'reset' : 'set';
if (data.err){
if(data.err){
return callback(data.err, collection, data, options);
}
collection[method](data.resp, options);
collection[method](data.response, options);
callback(data.err, collection, data, options);
collection.removeListeners([collection.events.onFetch]);
if(cbServer){
cbServer();
}
};

@@ -92,5 +88,5 @@

options.cb = options.callback;
options.callback = function cb(err, model, resp){
options.callback = function cb(err, model, response){
if (err){
return callback(err, model, resp, options);
return callback(err, model, response, options);
}

@@ -100,3 +96,3 @@ if (options.wait){

}
callback(null, model, resp, options);
callback(null, model, response, options);
};

@@ -166,5 +162,5 @@

// callback function if given
var callback = function(err, model, resp, options){
var callback = function(err, model, response, options){
if (options.cb){
options.cb(model, resp);
options.cb(model, response);
}

@@ -171,0 +167,0 @@ if (err){

{
"name": "ampersand-io-collection",
"version": "0.1.2",
"version": "0.1.3",
"description": "ampersand collection mixin based on rest collection mixin to be used with socket.io",

@@ -5,0 +5,0 @@ "main": "ampersand-io-collection.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc