Meteor/V3/Call Async

/icons/calendar.svg

Last update

Sep 24, 2024

This codemod replaces call with callAsync, since thats how meteor works with calls now.

Example

Before

import { Meteor } from 'meteor/meteor';
Meteor.methods({
async getAllData() {
return await MyCollection.find().fetch();
},
async otherMethod() {
return await MyCollection.find().fetch();
},
});
Meteor.call('getAllData');
Meteor.call('otherMethod');

After

import { Meteor } from 'meteor/meteor';
Meteor.methods({
async getAllData() {
return await MyCollection.find().fetchAsync();
},
async otherMethod() {
return await MyCollection.find().fetchAsync();
},
});
await Meteor.callAsync('getAllData');
await Meteor.callAsync('otherMethod');

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now