Creating a service to fetch RSS

In a nutshell, our application is about reading RSS feeds. So, it would be the right thing to start with the service, which fetches the feed by a given URL and parses it into a structure that we could attach to the applications state. I suggest retrieving the feed XML with the request (https://www.npmjs.com/package/request) module and parsing it using the feedme module (https://www.npmjs.com/package/feedme). Let's do it first in plain JavaScript. So, we need to install both the packages:

npm i -S feedme
npm i -S request

We are going to have a function rss that uses request to fetch feed contents though HTTP(s). This function will accept two arguments: feed URL and a callback function written in a thunk-like ...

Get Cross-platform Desktop Application Development: Electron, Node, NW.js, and React now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.