2016-10-28 5 views
0

나는과 같이, 비동기 콜백 함수에 의해 반환 Meteor.method에서 값을 반환하는 것을 시도하고있다 :메서드에서 비동기 결과를 반환하는 방법?

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

가 어디가 return result; 문을 넣어해야합니까?

+0

체크 아웃이 하나 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; 
    }); 
}); 
관련 문제