Ember/5/Fpe On
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