0

I am trying to return a value from a Meteor.method returned by an async callback function, like so:

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

Where should I put the return result; statement?

Anubhav Dhawan
  • 1,431
  • 6
  • 19
  • 35

1 Answers1

0

you can try this:

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