How does it work please explain and how to use?
I think the right questions are
-
Meteor.call
vsMeteor.apply
-
Meteor.callAsync
vsMeteor.applyAsync
These docs may help:
- Meteor.call: Methods | Meteor API Docs
- Meteor.callAsync: Methods | Meteor API Docs
- Meteor.apply: Methods | Meteor API Docs
- Meteor.applyAsync: Methods | Meteor API Docs
@minhna I have Method on server below
export const reportSummary = new ValidatedMethod({
name: 'pos.reportSummary',
mixins: [CallPromiseMixin],
applyOptions: {
noRetry: true,
},
validate:null,
async run(selector) {
// some code here
}
})
and then I call Method on client
Meteor.applyAsync('pos.reportSummary', this.form, (err, result)=>{
console.log(result)
})
But it does not working.
I donβt know what it does not working
mean. Be careful when you use Meteor.apply
and Meteor.applyAsync
function, the param you use will be different to Meteor.call
and Meteor.callAsync