Meteor/V3/Call Async

1.0.2Last update Oct 12, 2024
by@yugal41735

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