Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

backbone-callbacks

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-callbacks - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

11

backbone-callbacks.js

@@ -52,5 +52,10 @@ // BackboneCallbacks.js (c) 2012 Loren West and other contributors

// Place options if none were specified.
if (args.length === 0 || (args.length === 1 && methodName === 'save')) {
if (args.length === 0) {
args.push({});
}
// Place attributes if save and only options were specified
if (args.length === 1 && methodName === 'save') {
args.push({});
}
var options = args[args.length - 1];

@@ -63,3 +68,5 @@

options.error = function(model, response) {
callback(response, null);
// Provide the response as the error.
// Also provide it in 2nd arg for callback consistency.
callback(response, response);
};

@@ -66,0 +73,0 @@ }

2

package.json
{
"name": "backbone-callbacks",
"version": "0.1.0",
"version": "0.1.1",
"main": "./backbone-callbacks.js",

@@ -5,0 +5,0 @@ "description": "Anonymous callback style interface for Backbone.js async methods",

@@ -5,6 +5,6 @@ ## Anonymous callback interface for Backbone.js async methods

myModel.fetch({success: function() {
myModel.fetch({success: function(model, response) {
...
},
error: function() {
error: function(model, response) {
...

@@ -16,3 +16,3 @@ }

myModel.fetch(function(error) {
myModel.fetch(function(error, response) {
...

@@ -19,0 +19,0 @@ });

@@ -14,3 +14,3 @@ // CallbackTest.js (c) 2012 Loren West and other contributors

// method name into the result parameter to verify the call.
// It returns an error if options.errorTest is set.
// For error testing, it returns an error if the method is 'read'.
Backbone.sync = function(method, model, options) {

@@ -17,0 +17,0 @@ if (method === 'read') {

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