I'm starting with Meteor, and want to organize my methods... By example, I have 2 collecations: 'a' and 'b', both have the insert method.. I want to do something like that:
Meteor.methods({
a: {
insert : function(){
console.log("insert in Collection a");
}
},
b: {
insert : function(){
console.log("insert in Collection b");
}
}
});
And then callMeteor.call('a.insert');
It's possible to do this? Or how can I organize my methods?
I don't wanna make methods like: 'insertA' and 'insertB'
You could use this syntax :
Meteor.methods({
"a.insert": function(){
console.log("insert in Collection a");
}
"b.insert": function(){
console.log("insert in Collection b");
}
});
Which allows you to do Meteor.call("a.insert");
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With