Thursday, 4 February 2016

Running callback function in another file than the function?

Hello all,Is it possible to run method in another file and run callback in this file. LikeanotherFile.somefunction(items, function (items) { console.log(items); }); and the function in another file would be something like thisexports.somefunction(items, callback) { items.push("item"); callback(items); }; That didn't seem to work for me so what is actually wrong here? It runs the somefunction in another file fine but not the callback function.

Submitted February 04, 2016 at 09:47AM by Viped

No comments:

Post a Comment