tasks/hook.js
function () {
      var tasks = this.tasks.sort(function(a,b) {
        if (a.weight < b.weight) {
          return -1;
        } if (a.weight > b.weight) {
          return 1;
        }
        return 0;
      });

      var queue = [];
      for(var i=0;i<tasks.length; i+=1) {
        queue.push(tasks[i].name);
      }
      return queue;
    }
function () {
      var tasks = this.tasks.sort(function(a,b) {
        if (a.weight < b.weight) {
          return -1;
        } if (a.weight > b.weight) {
          return 1;
        }
        return 0;
      });

      var queue = [];
      for(var i=0;i<tasks.length; i+=1) {
        queue.push(tasks[i].name);
      }
      return queue;
    }
function ( ) { var tasks = this . tasks . sort ( function ( a , b ) { if ( a . weight < b . weight ) { return - 1 ; } if ( a . weight > b . weight ) { return 1 ; } return 0 ; } ) ; var queue = [ ] ; for ( var i = 0 ; i < tasks . length ; i += 1 ) { queue . push ( tasks [ i ] . name ) ; } return queue ; }
Get all tasks ordered by weight
@returns {Array}
Get all tasks ordered by weight