Skip to content

Releases: maissimples/backbone-ajax-retry

v1.2.1

11 Oct 12:12
0b193a5
Compare
Choose a tag to compare

Patch Changes

  • Preserve settings/options object on Backbone.sync and update it, instead of creating a new one;

All the changes

See all the changes between v1.2.1 over v1.2.0:
https://github.com/maissimples/backbone-ajax-retry/compare/v1.2.0..v1.2.1

v1.2.0

09 Oct 18:49
579ff71
Compare
Choose a tag to compare

Minor Changes

  • Override BackboneAjaxSettings' retries and model's with retries setting on Backbone.ajax.

    setupAjaxRetry(Backbone, { retries: 2 });
    
    Backbone.ajax({
      url: '/api/roles',
      retries: 3, // This overrides global retries configuration.
    });
    
    class User extends Backbone.Model {
      /**
       * @param {string} name
       * @returns {JQueryXHR}
       */
      changeName(name) {
        return this.save({ name }, {
          retries: 3, // This override both global and model's retries configuration.
        })
      }
    }

All the changes

See all the changes between v1.2.0 over v1.1.0:
https://github.com/maissimples/backbone-ajax-retry/compare/v1.1.0..v1.2.0

v1.1.0

09 Oct 12:15
182a283
Compare
Choose a tag to compare

Minor Changes

  • Override BackboneAjaxSettings' retries with model/collection retries attribute.

    setupAjaxRetry(Backbone, { retries: 2 });
    
    class User extends Backbone.Model {
      /** @override */
      retries = 5; // This override global retries configuration for this model's requests.
    }
  • Disable retry on create methods (e.g. Model.prototype.save when it was new) by default, and reads retryOnCreate attribute to override this configuration.

    class User extends Backbone.Model {
      /** @override */
      retryOnCreate = true; // This enables retrying create methods.
    }
  • Send model as argument to retry condition callback;

    import { setupAjaxRetry, hasRetryableStatus } from 'backbone-ajax-retry';
    
    setupAjaxRetry(Backbone, {
      condition(jqXHR, model, method) {
        if (model && model instanceof Authentication) {
          return false;
        }
    
        return hasRetryableStatus(jqXHR);
      }
    });

All the changes

See all the changes between v1.1.0 over v1.0.0:
https://github.com/maissimples/backbone-ajax-retry/compare/v1.0.0..v1.1.0

v1.0.0

08 Oct 12:48
776893a
Compare
Choose a tag to compare

Publish first package version.