Meteor Reactive Methods
Call methods synchronously inside Tracker.autorun.
Install with meteor add simple:reactive-method
Sometimes, you want to call a Meteor method inside of a template helper or Tracker.autorun computation, and get a return value. Now you can!
Before (doesn't work)
1Template.foo.helpers({ 2 methodResult: function () { 3 Meteor.call("myMethod", "a", "b", function (err, result) { 4 return result; // this doesn't work!!! 5 }); 6 } 7});
After (works!)
1Template.foo.helpers({ 2 methodResult: function () { 3 // Super fun! 4 return ReactiveMethod.call("myMethod", "a", "b"); 5 } 6});