I'm trying to map over some RSS feeds using feedparser-promised
, but my call to Promise.all()
isn't returning anything. (use of var
is from my REPL, which doesn't support const
or let
)
var feedparser = require('feedparser-promised');
var R = require('ramda');
var URLS = ['http://feeds.gawker.com/gizmodo/full',
'http://kotaku.com/vip.xml',
'http://www.medievalhistories.com/feed/'];
var getAllFeeds = (urls) => {
promises = R.map(feedparser.parse, urls);
Promise.all(promises)
.then((itemArrs) => itemArrs)
.catch((err) => {throw new Error(err)});
}
var x = getAllFeeds(URLS);
console.log(x);
x
comes back as undefined
. If I do a log on promises
, it shows as an array of Promises, as expected. What am I missing?