Ember/5/Cp Property Map

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

.property() is a modifier that adds additional property dependencies to an existing computed property. For filter, map, and sort computed property macros, this codemod ensures they receive an array of additional dependent keys as a second parameter.

Before

const Person = EmberObject.extend({
friendNames: map('friends', function (friend) {
return friend[this.get('nameKey')];
}).property('nameKey'),
});

After

const Person = EmberObject.extend({
friendNames: map('friends', ['nameKey'], function (friend) {
return friend[this.get('nameKey')];
}),
});

Build custom codemods

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

background illustrationGet Started Now