Skip to content

Commit f4a96c1

Browse files
author
John Edward
committed
fix push from normal sync func
1 parent 776ee39 commit f4a96c1

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const config = {
3434
name: 'id' // name of the field to reference from
3535
}
3636

37-
const q = RequestQ(config);
37+
const q = RequestQ(config);
3838
```
3939

4040
## License

src/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class Queue {
1111
}
1212

1313
/**
14-
* @method _async
14+
* @method _sync
1515
* @description wraps callable request
16-
* and added to the stack
16+
* and added to the single stack
1717
*
1818
* @param {Function} fn, xp request function
1919
*/
@@ -22,11 +22,16 @@ class Queue {
2222
this.fn = fn;
2323

2424
return (req, res, next) => {
25-
this.push(fn, { req, res, next });
25+
this.push({ req, res, next });
2626
this.emit();
2727
}
2828
}
2929

30+
/**
31+
* @method setFn
32+
* @description set req callback for this queue
33+
*/
34+
3035
setFn = (fn) => {
3136
this.fn = fn;
3237
}
@@ -35,8 +40,7 @@ class Queue {
3540
* @method push
3641
* @description adds request to the stack
3742
*
38-
* @param {Function} fn, xp request function
39-
* @param {*} http, xp req, res, next objects
43+
* @param {*} http, xp req, res and next objects
4044
*/
4145

4246
push = (http) => {

0 commit comments

Comments
 (0)