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] Makes the @action decorator work in classic classes #17827

Merged
merged 1 commit into from
Apr 1, 2019

Commits on Mar 31, 2019

  1. [FEAT] Makes the @action decorator work in classic classes

    Currently, the new `@action` decorator is the only decorator in Ember
    proper that doesn't work in classic classes currently. Since users could
    define actions on the actions hash in classic classes, we didn't
    originally see a reason for it to work in classic classes. However, with
    the fact that the decorator now _binds context_, it may actually become
    useful for users, especially if they decide to convert away from the
    `{{action}}` modifier/helper.
    
    ```js
    const FooComponent = Component.extend({
      myAction: action(function() {
        // do a thing
      }),
    });
    ```
    
    Additionally, this makes them match up with our learning story for the
    rest of decorators - they're _always_ decorators, they just use
    different syntax in native classes and classic classes.
    Chris Garrett committed Mar 31, 2019
    Configuration menu
    Copy the full SHA
    528d671 View commit details
    Browse the repository at this point in the history