Ember/5/Fpe On

1.0.1Last update Jul 24, 2024
by@Codemod
Ember
migration

Before

import EmberObject from '@ember/object';
import { sendEvent } from '@ember/object/events';
let Job = EmberObject.extend({
logCompleted: function () {
console.log('Job completed!');
}.on('completed'),
});
let job = Job.create();
sendEvent(job, 'completed'); // Logs 'Job completed!'

After

import EmberObject from '@ember/object';
import { on } from '@ember/object/evented';
import { sendEvent } from '@ember/object/events';
let Job = EmberObject.extend({
logCompleted: on('completed', function () {
console.log('Job completed!');
}),
});
let job = Job.create();
sendEvent(job, 'completed'); // Logs 'Job completed!'

Build custom codemods

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

background illustrationGet Started Now