react-backbone v0.26.0 Release Notes

Release Date: 2015-03-31 // about 9 years ago
    • overhaul the loadWhile mixin - 2e52ce9

    🔦 Exposes the loadWhile(callback[, loadingStateAttribute]) function

    • callback: the function that will be executed containing any XHR activity to be monitored
    • loadingStateAttribute: the attribute ("loading" if not provided) to reference the loading state

    Set the component state attribute ("loading" or loadingStateAttribute if provided) to a truthy value while any XHR activity is in progress as long as it was initiated during the execution of the callback function.

        React.createComponent({
          mixins: ['loadWhile'],
    
          doSomething: function() {
            this.loadWhile(function() {
              // the "loading" attribute will be truthy as long as any of these fetches are in progress
              this.props.collection1.fetch();
              this.props.collection2.fetch();
              this.props.collection3.fetch();
            });
          }
        });
    

    Commits