Feature/8 return a promise #5
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -59,7 +59,7 @@ function randomBunny(subreddit, sortBy, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function promise(subreddit, sortBy) {
|
function promise(subreddit, sortBy) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
// If the sortable list doesn't include sortBy, default to 'hot'
|
// If the sortable list doesn't include sortBy, default to 'hot'
|
||||||
if (!sortable.includes(sortBy)) sortBy = 'hot';
|
if (!sortable.includes(sortBy)) sortBy = 'hot';
|
||||||
|
|
||||||
|
@ -118,4 +118,4 @@ function getRandom(min, max) {
|
||||||
module.exports = {
|
module.exports = {
|
||||||
randomBunny,
|
randomBunny,
|
||||||
promise,
|
promise,
|
||||||
}
|
};
|
Loading…
Reference in a new issue