Multiple calls hanging browser

18 views
Skip to first unread message

Josh Fisher

unread,
Jul 19, 2019, 6:03:23 PM7/19/19
to Dandelion Support Forum
I'm using the dandelion text similarity api with a callback. For a reason I can't figure out, the calls to the api won't stop and they end up hanging the browser.
Any ideas?

Giacomo Berardi

unread,
Jul 22, 2019, 4:46:02 AM7/22/19
to Dandelion Support Forum
Hi Josh,

can you show me an example of problematic call? Be careful of hiding you token in the snippet

Regards
Giacomo Berardi
Dandelion team

Josh Fisher

unread,
Jul 22, 2019, 7:24:44 AM7/22/19
to Dandelion Support Forum
Sure. I just copied the code from the example Node integration to test it:

var dandelion = require("node-dandelion");
dandelion.configure({
  "app_key":"my token",
  "app_id":"my token"
});

dandelion.txtSim(
  {
    "string1": {
      "type":"txt",
      "value":"Reports that the NSA eavesdropped on world leaders have \"severely shaken\" relations between Europe and the U.S., German Chancellor Angela Merkel said."
    },
    "string2":{
      "type":"txt",
      "value":"Germany and France are to seek talks with the US to settle a row over spying, as espionage claims continue to overshadow an EU summit in Brussels."
    },
    "lang":"en",
    "bow":"never"
  },
  function(results){
    console.log(results);
  }
);
It just prints to the console until I close the browser. This is in the context of a React app.

Josh Fisher

unread,
Jul 22, 2019, 7:25:57 AM7/22/19
to Dandelion Support Forum
Forgot to include the import statement, npm install node-dandelion, etc. But those both work as expected.
Reply all
Reply to author
Forward
0 new messages