Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Controller from '@ember/controller';
import Ember from 'ember';
import { assign } from '@ember/polyfills';
import { map } from '@ember/object/computed';

export default Controller.extend({
fullName: computed('firstName', 'lastName', function() {
Expand All @@ -11,6 +12,10 @@ export default Controller.extend({
return `${this.firstName} ${this.lastName}`;
},

friendNames: map('friends', ['nameKey'], function(friend) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you import map? Just in case the codemod starts following the source in the future, and not codemodding things that don't come from ember.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, similarly for the computed properties also we need to import the computed right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, but I wouldn't worry about it for this pull request

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then, I will make changes for importing map

return friend[this.nameKey];
}),

actions: {
foo(object) {
this.doStuff(object);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
import { merge } from '@ember/polyfills';
import { map } from '@ember/object/computed';

export default Ember.Controller.extend({
fullName: computed(function() {
Expand All @@ -10,6 +11,10 @@ export default Ember.Controller.extend({
return `${this.firstName} ${this.lastName}`;
}).volatile('firstName', 'lastName'),

friendNames: map('friends', function(friend) {
return friend[this.nameKey];
}).property('nameKey'),

actions: {
foo(object) {
Ember.propertyWillChange(object, 'someProperty');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Controller from '@ember/controller';
import Ember from 'ember';
import { assign } from '@ember/polyfills';
import { map } from '@ember/object/computed';

export default Controller.extend({
fullName: computed('firstName', 'lastName', function() {
Expand All @@ -11,6 +12,10 @@ export default Controller.extend({
return `${this.firstName} ${this.lastName}`;
},

friendNames: map('friends', ['nameKey'], function(friend) {
return friend[this.nameKey];
}),

actions: {
foo(object) {
this.doStuff(object);
Expand Down