JSON Streaming in React Native

I'm building a React Native app that has to listen on a JSON stream, something similar to node's JSONStream/EventStream style (https://www.npmjs.com/package/JSONStream) . Packages like JSONStream can't get imported into React Native due to platform issues. Does anyone have suggestions on how to do the equivalent streaming in react native?

The way it works in Node is:

var request = require('request');
var JSONStream = require('JSONStream');
var es = require('event-stream');

request(options) 
    .pipe(JSONStream.parse('*')) 
    .pipe(es.map(function(message) { 
      handle(message) 
    }));

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

flutter websocket connection issue