2.1.1 • Published 8 years ago

sequeue v2.1.1

Weekly downloads
78
License
MIT
Repository
github
Last release
8 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

8 years ago

2.1.0

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago