2016-10-28 9 views
0

私はそうのように、非同期コールバック関数によって返さMeteor.methodから値を返すようにしようとしています:私はreturn result;文を置くべきメソッドから非同期の結果を返す方法は?

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

+0

チェックアウトこの1:http://stackoverflow.com/questions/26226583/meteor-proper-use-of-meteor-wrapasync-on-server –

答えて

0

あなたはこれを試すことができます。

Meteor.method('myMethod',() => { 
    return asyncFunction(result => { 
     // Meteor.method should return this result 
return result; 
    }); 
}); 
関連する問題