2.1.1 • Published 7 years ago

sequeue v2.1.1

Weekly downloads
78
License
MIT
Repository
github
Last release
7 years ago

sequeue

# installation
$ npm install sequeue

Sequeue can be used in node, with AMD (require.js) or without any module loader.

Node:

var sequeue = require('sequeue');

sequeue([
  function(next) {
    setTimeout(function() {
      console.log(1);
      next();
    }, 1000);
  },
  function() {
    console.log(2);
    // last function should not call next()
    // otherwise you will get an "undefined is not a function"
  }
]);

// will output:
// 1
// 2

AMD:

define(['./sequeue'], function (sequeue) {
  // usage
  var sequeue = require('sequeue');


  sequeue([
    function(next) {
      setTimeout(function() {
        console.log(1);
        next();
      }, 1000);
    },
    function() {
      console.log(2);
      // last function should not call next()
      // otherwise you will get an "undefined is not a function"
    }
  ]);

  // will output:
  // 1
  // 2
});

Without module loader:

(function(window) {
  // usage
  var sequeue = window.sequeue;

  sequeue([
    function(next) {
      setTimeout(function() {
        console.log(1);
        next();
      }, 1000);
    },
    function() {
      console.log(2);
      // last function should not call next()
      // otherwise you will get an "undefined is not a function"
    }
  ]);

  // will output:
  // 1
  // 2
})(window);
2.1.1

7 years ago

2.1.0

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago