UNPKG

687 BJavaScriptView Raw
1module.exports = function (everycss, root, processors, success, error) {
2 var that = this,
3 cursor = -1;
4
5 Object.defineProperty(this, 'everycss', {
6 get: function () {
7 return everycss;
8 }
9 });
10
11 this.next = function () {
12 cursor++;
13 if (processors[cursor]) {
14 processors[cursor][0].call(that, root, processors[cursor][1]);
15 } else {
16 if (typeof success === 'function') {
17 success.call(null, root);
18 }
19 }
20 };
21
22 this.replay = function () {
23 if (processors[cursor]) {
24 processors[cursor][0].call(that, root, processors[cursor][1]);
25 }
26 };
27
28 this.error = function () {
29 error.call(null, root);
30 };
31
32 this.next();
33};
\No newline at end of file