2.1.2 • Published 2 years ago

ember-functions-as-helper-polyfill v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ember-functions-as-helper-polyfill

npm version CI

Use plain functions as helpers. Polyfill for RFC: 756 | Default Helper Manager. On Ember.js versions with native support for the feature (4.5+), this addon is inert.

Compatibility

  • Ember.js v3.25 or above
  • Ember CLI v3.25 or above
  • ember-auto-import v1 or above

Installation

ember install ember-functions-as-helper-polyfill

Usage

Define a function (doesn't have to be in a component)

import Component  from '@glimmer/component';

export default class MyComponent extends Component {
  myHelper = x => x * 2;
}
{{this.myHelper 3}}
^ prints 6

Named arguments will all be grouped together in the last argument of the helper:

import Component  from '@glimmer/component';

export default class MyComponent extends Component {
  doStuff = (x, options) => {
    console.log(x, options.optionA, options.optionB);
  };
}
{{this.doStuff 3 optionA=2 optionB=3}}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

2.1.2

2 years ago

2.1.1

3 years ago

2.1.0

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.11

3 years ago

1.0.10

4 years ago

1.0.15

3 years ago

1.0.14

3 years ago

2.0.1

3 years ago

1.0.13

3 years ago

2.0.0

3 years ago

1.0.12

3 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago