2016-10-28 2 views
0

Ich versuche, einen Wert aus einem Meteor.method durch eine Asynchron-Callback-Funktion zurückgegeben zurückzukehren, etwa so:Wie gibt man asynchrone Ergebnisse von einer Methode zurück?

Meteor.method('myMethod',() => { 
    asyncFunction(result => { 
     // Meteor.method should return this result 
    }); 
}); 

Wo soll ich die return result; Anweisung setzen?

+0

Kasse diese: http://stackoverflow.com/questions/26226583/meteor-proper-use-of-meteor-wrapasync-on-server –

Antwort

0

Sie können dies versuchen:

Meteor.method('myMethod',() => { 
    return asyncFunction(result => { 
     // Meteor.method should return this result 
return result; 
    }); 
}); 
Verwandte Themen