GithubHelp home page GithubHelp logo

backbone-ajaxretry's People

Contributors

gdibble avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

backbone-ajaxretry's Issues

Uncaught TypeError: Cannot read property 'ajax' of undefined

Users have reported JS error.

Temporary fix (until this is resolved) includes adding the following first-line to the Backbone.ajax extend-function before the return:

  Backbone.$ = $; // <<< add as temp-fix
  return Backbone.$.ajax.apply(Backbone.$, args);

bug in extender fn

apologies w/ v1.2.0. when using $.get or $.post shortcuts, first argument is a string and thus internal extender function had a bug.

POST response 200 w/o body still retries

a POST with a response-body, PUT, GET, DELETE all work as expected,
but a POST with res.status 200 and no response-body keeps retrying the successful req.

considering checking jqXHR.status < 300 >>> _exhausted()

pass error arguments to exhaust

$.ajax returns arguments to the error callback:
( jqXHR jqXHR, String textStatus, String errorThrown )

These arguments should be passed forward to the exhaust callback such that the developer can do something like:

function onExhaust(jqXHR, textStatus, errorThrown) {
  console.log(jqXHR, textStatus, errorThrown);
  if (jqXHR.status > 500) {
    //do something about Server Error
  } else if (jqXHR.status > 400) {
    //do something about Client Error
  }
}

myModel.fetch({ exhaust:onExhaust });

ability to overload settings per instantiation

For example, in my app I want to use the default of { retryCount:3 } in most cases,
but this particular fetch I would like to try more or less, i.e.

myModel1.fetch({
  retryCount: 99
});
// ||
myModel2.fetch({
  retryCount: 0
});

Any setting, default or via .set, should allow overloading (thus superseding settings) from the current instantiation.

minify main js file

provide compress library for Backbone apps requiring library on-the-fly and developers who include this module via HTML or lazy-loading.

initial estimate shows 51% reduction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.