Monday, 29 May 2017

.then() on node modules not working?

I'm working on a react native app right now and I wrote my own module to store some information separated from my components.

While I did that I noticed that in my module I created, I had a function like this:

test = function(url){
return fetch(url);
}

exports.test = testFetch;

In my main module I did the following:

import ts from 'test-module'

ts.testFetch("http://example.com").then((response) => {console.log(response)});

But .then() is not getting fired for any reason. The request went through and was successful.

Any help on this?



via DehWeh

No comments:

Post a Comment