I have a series of recursive promises that cross the hierarchy to obtain the parent of the current node As long as it does not reach the top. I can fix the result, but I do not know how to get the results stored. I'm using Bluebird to create getNodeData promise.
var getParent = function (node) {getNodeData (node). Then (function (node) {if (term.parent) {getParent (node. Parent);} and {// return all the nodes as an array}}); }; };
You have to change your statement to come back and add another function to the chain Do something with responses with those promises.
var getParent = function (word, classifier) {return data Retriver.getNodeData (node). Then (work (node) {if (term.parent) {return getParent (node.parent);} else {// return all the nodes as an array return node;}}); }; }; GetParent (word, classifier). Then (function (node) {// stuff with node}};
Comments
Post a Comment