Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Add fpe-observes codemod #32

Merged
merged 2 commits into from
Nov 6, 2019
Merged

Conversation

rajasegar
Copy link
Contributor

@rajasegar rajasegar commented Nov 2, 2019

#21

Function.prototype.observes

Historically, Ember has extended the Function.prototype with a few functions (on, observes, property), over time we have moved away from using these prototype extended functions in favor of using the official ES modules based API.

Before

import EmberObject from '@ember/object';

export default EmberObject.extend({
  valueObserver: function() {
    // Executes whenever the "value" property changes
  }.observes('value')
});

After

import EmberObject, { observer } from '@ember/object';

export default EmberObject.extend({
  valueObserver: observer('value', function() {
    // Executes whenever the "value" property changes
  })
});

@rajasegar rajasegar changed the title [FEAT] Add fpe-observes codemod WIP [FEAT] Add fpe-observes codemod Nov 2, 2019
@rajasegar rajasegar changed the title WIP [FEAT] Add fpe-observes codemod [FEAT] Add fpe-observes codemod Nov 5, 2019
@kellyselden kellyselden merged commit 947b193 into ember-cli:v3 Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants