Saturday, February 4, 2023
HomeJavaScriptNew Meteor.js 2.10 and the Async Tracker Function | by Gabriel Grubba...

New Meteor.js 2.10 and the Async Tracker Function | by Gabriel Grubba | Jan, 2023


Tracker.autorun(async operate example1() {
let asyncData = await asyncDataFunction();
let customers = Meteor.customers.discover({}).fetch();
});
Tracker.autorun(async operate example2()  {
let customers = Meteor.customers.discover({}).fetch();
let asyncData = await asyncDataFunction();
});
Tracker.autorun(async operate example1(computation) {
let asyncData = await Tracker.withComputation(computation, () => asyncDataFunction());
let customers = Meteor.customers.discover({}).fetch();
});
Tracker.autorun(async operate example2(computation) {
let asyncData = await Tracker.withComputation(computation, () => asyncDataFunction());
let customers = await Tracker.withComputation(computation, () => Meteor.customers.discover({}).fetchAsync());
});
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments