Node.js, как прервать загрузку файла, когда файл тяжелее, чем требуется, не дожидаясь загрузки всего файла?

Этот ответ на некоторые хитроумные

componentDidMount() {
    fetch('http://example.com/rss.xml')
      .then((response) => response.text())
      .then((response) => {
        parseString(response, function (err, result) {
          this.setState({
            articles: JSON.stringify(result.rss.channel[0].item)
          })
          console.log('RAW: '  + result.rss.channel[0].item);
setTimeout(() => {
   console.log('THIS: ' + this.state.articles);
}, 1000);

        }.bind(this));
      });
  }
0
задан Raz 18 January 2019 в 18:37
поделиться