Collection of helpers to aid in reactive template programming with Ember.js.
ember install ember-reactive-helpers
Reactive helpers are helpers that return functions. These functions can be bound to event handlers to process data on the way up in the Data Down Actions Up cycle. The r
helper makes it possible to use ember-composable-helpers
in event handlers where execution of the helper is delayed until the event is triggered.
Returns a function for a given helper and curries arguments to it.
The r
helper accepts functions as helpers. For example, let's say you have a method in a Component named addNumbers
export default class extends Component {
addNumbers([a, b]) {
return a + b;
}
}
You can use it in the template.
The (r/get)
helper returns a function. When called, the function will return the value taken from the object that it receives as the first argument at property propName.
(r/param)
returns a function. When called, this function will return the received argument at the specified index.
(r/debugger)
will create a helper that will inject a debugger breakpoint into a helper pipe.
It will pass through the value, that's passed into the helper.
The (r/log)
helper will evaluate to a function. When called, this function will log the passed in message and arguments that it received.
The (r/tap value)
helper will evaluate to a function that will return the passed in argument.
The {{shhh
helper will suppress any output that's passed into it. This is useful when you want to compute a helper
without having its output rendered.
The (transition-to)
helper has the same argument signature as link-to
but evaluates to an action that can be called to trigger transition.
If you encounter a bug please open an issue on GitHub.
- Ember.js v3.12 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
See the Contributing guide for details.
This project is licensed under the MIT License.